Overslaan naar inhoud
Odoo Menu
  • Aanmelden
  • Probeer het gratis
  • Apps
    Financiën
    • Boekhouding
    • Facturatie
    • Onkosten
    • Spreadsheet (BI)
    • Documenten
    • Ondertekenen
    Verkoop
    • CRM
    • Verkoop
    • Kassasysteem winkel
    • Kassasysteem Restaurant
    • Abonnementen
    • Verhuur
    Websites
    • Websitebouwer
    • E-commerce
    • Blog
    • Forum
    • Live Chat
    • E-learning
    Bevoorradingsketen
    • Voorraad
    • Productie
    • PLM
    • Inkoop
    • Onderhoud
    • Kwaliteit
    Personeelsbeheer
    • Werknemers
    • Werving & Selectie
    • Verlof
    • Evaluaties
    • Aanbevelingen
    • Wagenpark
    Marketing
    • Sociale media-marketing
    • E-mailmarketing
    • Sms-marketing
    • Evenementen
    • Marketingautomatisering
    • Enquêtes
    Diensten
    • Project
    • Urenstaten
    • Buitendienst
    • Helpdesk
    • Planning
    • Afspraken
    Productiviteit
    • Chat
    • Artificiële Intelligentie
    • IoT
    • VoIP
    • Kennis
    • WhatsApp
    Apps van derden Odoo Studio Odoo Cloud Platform
  • Bedrijfstakken
    Detailhandel
    • Boekhandel
    • kledingwinkel
    • Meubelwinkel
    • Supermarkt
    • Bouwmarkt
    • Speelgoedwinkel
    Horeca & Hospitality
    • Bar en café
    • Restaurant
    • Fastfood
    • Gastenverblijf
    • Drankenhandelaar
    • Hotel
    Vastgoed
    • Makelaarskantoor
    • Architectenbureau
    • Bouw
    • Vastgoedbeheer
    • Tuinieren
    • Vereniging van mede-eigenaren
    Consulting
    • Accountantskantoor
    • Odoo Partner
    • Marketingbureau
    • Advocatenkantoor
    • Talentenwerving
    • Audit & Certificering
    Productie
    • Textiel
    • Metaal
    • Meubels
    • Eten
    • Brouwerij
    • Relatiegeschenken
    Gezondheid & Fitness
    • Sportclub
    • Opticien
    • Fitnesscentrum
    • Wellness-medewerkers
    • Apotheek
    • Kapper
    Diensten
    • Klusjesman
    • IT-hardware & ondersteuning
    • Zonne-energiesystemen
    • Schoenmaker
    • Schoonmaakdiensten
    • HVAC-diensten
    Andere
    • Non-profitorganisatie
    • Milieuagentschap
    • Verhuur van Billboards
    • Fotograaf
    • Fietsleasing
    • Softwareverkoper
    Alle bedrijfstakken bekijken
  • Community
    Leren
    • Tutorials
    • Documentatie
    • Certificeringen
    • Training
    • Blog
    • Podcast
    Versterk het onderwijs
    • Onderwijsprogramma
    • Scale Up! Business Game
    • Odoo bezoeken
    Download de Software
    • Downloaden
    • Vergelijk edities
    • Releases
    Werk samen
    • Github
    • Forum
    • Evenementen
    • Vertalingen
    • Partner worden
    • Diensten voor partners
    • Registreer je accountantskantoor
    • Referral Program
    Diensten
    • Vind een partner
    • Vind een boekhouder
    • Een adviseur ontmoeten
    • Implementatiediensten
    • Klantreferenties
    • Ondersteuning
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Vraag een demo aan
  • Prijzen
  • Help
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Alle posts Personen Badges
Labels (Bekijk alle)
odoo accounting v14 pos v15
Over dit forum
Help

Calculate Product Cost Price through BoM

Inschrijven

Ontvang een bericht wanneer er activiteit is op deze post

Deze vraag is gerapporteerd
v8mrpcost_pricebom
1 Beantwoorden
11370 Weergaven
Avatar
Herman

I use Average pricing so that my raw materials' cost will be updated with each Purchase. But how do I make my Product's price with BoMs update according to materials/products price updates? I have over 200 000 thousand products, so this cant be done manually

0
Avatar
Annuleer
Avatar
E.R. Spada
Beste antwoord

We created a cron in v8 to update standard cost with bom, it is the only way. I have no idea why this is not built in. We extended the product_extended_module, here is the function:

class product_template(osv.osv):

_name = 'product.template'

_inherit = 'product.template'


Here is the wizard:

from openerp.exceptions import except_orm

from openerp.osv import fields, osv

from openerp.tools.translate import _

class wizard_price(osv.osv):

_name = "wizard.price"

_description = "Compute price wizard"

_columns = {

'info_field': fields.text('Info', readonly=True),

'real_time_accounting': fields.boolean("Generate accounting entries when real-time"),

'recursive': fields.boolean("Change prices of child BoMs too"),

}

def default_get(self, cr, uid, fields, context=None):

res = super(wizard_price, self).default_get(cr, uid, fields, context=context)

product_pool = self.pool.get('product.template')

product_obj = product_pool.browse(cr, uid, context.get('active_id', False))

if context is None:

context = {}

rec_id = context and context.get('active_id', False)

assert rec_id, _('Active ID is not set in Context.')

res['info_field'] = str(product_pool.compute_price(cr, uid, [], template_ids=[product_obj.id], test=True, context=context))

return res

def compute_from_bom(self, cr, uid, ids, context=None):

assert len(ids) == 1

if context is None:

context = {}

model = context.get('active_model')

if model != 'product.template':

raise except_orm(_('Wrong model!'), _('This wizard is build for product templates, while you are currently running it from a product variant.'))

rec_id = context and context.get('active_id', False)

assert rec_id, _('Active ID is not set in Context.')

prod_obj = self.pool.get('product.template')

res = self.browse(cr, uid, ids, context=context)

prod = prod_obj.browse(cr, uid, rec_id, context=context)

prod_obj.compute_price(cr, uid, [], template_ids=[prod.id], real_time_accounting=res[0].real_time_accounting, recursive=res[0].recursive, test=False, context=context)

def compute_price_schedular(self, cr, uid, context=None):

print "-------------------------------schedular calling-------------------------------------------"

template_ids = self.search(cr,uid, [("cost_method","=","standard")])

print "template_ids----",template_ids

if template_ids:

self.compute_price(cr, uid, [],template_ids=template_ids, recursive=True, test=False, real_time_accounting = False, context=None)

return True

def compute_price(self, cr, uid, product_ids, template_ids=False, recursive=False, test=False, real_time_accounting = False, context=None):

'''

Will return test dict when the test = False

Multiple ids at once?

testdict is used to inform the user about the changes to be made

'''

testdict = {}

if product_ids:

ids = product_ids

model = 'product.product'

else:

ids = template_ids

model = 'product.template'

if not ids:

return True

for prod_id in ids:

bom_obj = self.pool.get('mrp.bom')

if model == 'product.product':

bom_id = bom_obj._bom_find(cr, uid, product_id=prod_id, context=context)

else:

bom_id = bom_obj._bom_find(cr, uid, product_tmpl_id=prod_id, context=context)

if bom_id:

# In recursive mode, it will first compute the prices of child boms

if recursive:

#Search the products that are components of this bom of prod_id

bom = bom_obj.browse(cr, uid, bom_id, context=context)

#Call compute_price on these subproducts

prod_set = set([x.product_id.id for x in bom.bom_line_ids])

res = self.compute_price(cr, uid, list(prod_set), recursive=recursive, test=test, real_time_accounting = real_time_accounting, context=context)

if test:

testdict.update(res)

#Use calc price to calculate and put the price on the product of the BoM if necessary

price = self._calc_price(cr, uid, bom_obj.browse(cr, uid, bom_id, context=context), test=test, real_time_accounting = real_time_accounting, context=context)

if test:

testdict.update({prod_id : price})

if test:

return testdict

else:

return True

-1
Avatar
Annuleer
Emipro Technologies Pvt. Ltd.

No one can even understand your answer. Please use "Code" style from editor.

Geniet je van het gesprek? Blijf niet alleen lezen, doe ook mee!

Maak vandaag nog een account aan om te profiteren van exclusieve functies en deel uit te maken van onze geweldige community!

Aanmelden
Gerelateerde posts Antwoorden Weergaven Activiteit
Subcontracting Product with multiple BoM
mrp bom
Avatar
0
okt. 25
3117
BOM with some item quantity which not depends of the whole quantity to produce Opgelost
mrp bom
Avatar
Avatar
1
jun. 25
6941
How to show BOM matrix with quantity of used product?
mrp bom
Avatar
0
feb. 19
6018
Discrepancy between MRP Cost Report and Compute From BOM Calculation
mrp bom
Avatar
0
nov. 18
5449
BOM cost - odoo 8 online -
cost_price bom
Avatar
Avatar
Avatar
3
aug. 17
6927
Community
  • Tutorials
  • Documentatie
  • Forum
Open Source
  • Downloaden
  • Github
  • Runbot
  • Vertalingen
Diensten
  • Odoo.sh Hosting
  • Ondersteuning
  • Upgrade
  • Gepersonaliseerde ontwikkelingen
  • Onderwijs
  • Vind een boekhouder
  • Vind een partner
  • Partner worden
Over ons
  • Ons bedrijf
  • Merkelementen
  • Neem contact met ons op
  • Vacatures
  • Evenementen
  • Podcast
  • Blog
  • Klanten
  • Juridisch • Privacy
  • Beveiliging
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk Slovenščina Español (América Latina) Español Svenska ภาษาไทย Türkçe українська Tiếng Việt

Odoo is een suite van open source zakelijke apps die aan al je bedrijfsbehoeften voldoet: CRM, E-commerce, boekhouding, inventaris, kassasysteem, projectbeheer, enz.

Odoo's unieke waardepropositie is om tegelijkertijd zeer gebruiksvriendelijk en volledig geïntegreerd te zijn.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now