Skip to Content
Odoo Menu
  • Log ind
  • Prøv gratis
  • Apps
    Økonomi
    • Bogføring
    • Fakturering
    • Udgifter
    • Regneark (BI)
    • Dokumenter
    • e-Signatur
    Salg
    • CRM
    • Salg
    • POS Butik
    • POS Restaurant
    • Abonnementer
    • Udlejning
    Hjemmeside
    • Hjemmesidebygger
    • e-Handel
    • Blog
    • Forum
    • LiveChat
    • e-Læring
    Forsyningskæde
    • Lagerbeholdning
    • Produktion
    • PLM
    • Indkøb
    • Vedligeholdelse
    • Kvalitet
    HR
    • Medarbejdere
    • Rekruttering
    • Fravær
    • Medarbejdersamtaler
    • Anbefalinger
    • Flåde
    Marketing
    • Markedsføring på sociale medier
    • E-mailmarketing
    • SMS-marketing
    • Arrangementer
    • Automatiseret marketing
    • Spørgeundersøgelser
    Tjenester
    • Projekt
    • Timesedler
    • Udkørende Service
    • Kundeservice
    • Planlægning
    • Aftaler
    Produktivitet
    • Dialog
    • Godkendelser
    • IoT
    • VoIP
    • Vidensdeling
    • WhatsApp
    Tredjepartsapps Odoo Studio Odoo Cloud-platform
  • Brancher
    Detailhandel
    • Boghandel
    • Tøjforretning
    • Møbelforretning
    • Dagligvarebutik
    • Byggemarked
    • Legetøjsforretning
    Mad og værtsskab
    • Bar og pub
    • Restaurant
    • Fastfood
    • Gæstehus
    • Drikkevareforhandler
    • Hotel
    Ejendom
    • Ejendomsmægler
    • Arkitektfirma
    • Byggeri
    • Ejendomsadministration
    • Havearbejde
    • Boligejerforening
    Rådgivning
    • Regnskabsfirma
    • Odoo-partner
    • Marketingbureau
    • Advokatfirma
    • Rekruttering
    • Audit & certificering
    Produktion
    • Tekstil
    • Metal
    • Møbler
    • Fødevareproduktion
    • Bryggeri
    • Firmagave
    Heldbred & Fitness
    • Sportsklub
    • Optiker
    • Fitnesscenter
    • Kosmetolog
    • Apotek
    • Frisør
    Håndværk
    • Handyman
    • IT-hardware og support
    • Solenergisystemer
    • Skomager
    • Rengøringsservicer
    • VVS- og ventilationsservice
    Andet
    • Nonprofitorganisation
    • Miljøagentur
    • Udlejning af billboards
    • Fotografi
    • Cykeludlejning
    • Softwareforhandler
    Gennemse alle brancher
  • Community
    Få mere at vide
    • Tutorials
    • Dokumentation
    • Certificeringer
    • Oplæring
    • Blog
    • Podcast
    Bliv klogere
    • Udannelselsesprogram
    • Scale Up!-virksomhedsspillet
    • Besøg Odoo
    Få softwaren
    • Download
    • Sammenlign versioner
    • Udgaver
    Samarbejde
    • Github
    • Forum
    • Arrangementer
    • Oversættelser
    • Bliv partner
    • Tjenester til partnere
    • Registrér dit regnskabsfirma
    Modtag tjenester
    • Find en partner
    • Find en bogholder
    • Kontakt en rådgiver
    • Implementeringstjenester
    • Kundereferencer
    • Support
    • Opgraderinger
    Github Youtube Twitter LinkedIn Instagram Facebook Spotify
    +1 (650) 691-3277
    Få en demo
  • Prissætning
  • Hjælp

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Bogføring
  • Lager
  • PoS
  • Projekt
  • MRP
All apps
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Du skal være registreret for at interagere med fællesskabet.
All Posts People Emblemer
Tags (View all)
odoo accounting v14 pos v15
Om dette forum
Hjælp

Variable production in odoo 11 [SOLVED]

Tilmeld

Få besked, når der er aktivitet på dette indlæg

Dette spørgsmål er blevet anmeldt
productionbom
2 Besvarelser
8130 Visninger
Avatar
Nicolas Plennevaux

I'm developing a solution for a small company which is dedicated to produce aromatic plats for cooking. The producction process is as follows: We plant a fixed cantity of a plant, the plant is feeded for a time, after is recolected and dryed an finally is packed on 5g package. The problem is that for a fixed quantity of plants we will never get the same wheight of dryed product. I think that it's a common issue because this variable produccion is related with all produccion process for natural products, as milk, honey, vegetables, meat, etc...

Is there any way to affort that problem?


0
Avatar
Kassér
Avatar
Nicolas Plennevaux
Forfatter Bedste svar

I get a possible solution making qty_done field as editable with a custom module. It seems to work properly, updating stock quantity without changing consumed materials. But still having an issue, i get two stock move lines, the orignal one with planned quantity of finished goods and other with increased quantity. Is there any way to avoid this constraints?, it makes really poor user friendly reports to final user.


[SOLVED]

After a little research i found a solution that works, i have'nt tested in production stage but i could'nt find errors on tests. If you use the solution and find some issues, please, post it here.

I made a custom module that overrides write and _compute_consumed_less_than_planed  to be able to save products produced independent of raw materials.

1. Set qty_done editable

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="mrp_production" model="ir.ui.view">
<field name="name">mrp.production.form</field>
<field name="model">mrp.production</field>
<field name="inherit_id" ref="mrp.mrp_production_form_view"/>
<field name="view_type">form</field>
<field name="arch" type="xml">
<xpath expr="//field[@name='finished_move_line_ids']" position="attributes">
<attribute name="attrs">{'readonly': False}</attribute>
</xpath>
</field>
</record>
</odoo>

2. Override mrp_production methods

class mrp_production(models.Model):

_inherit = 'mrp.production'
        
    # Override write method to set equal quantity of product
    # on stock_move and stock_move_line relation
@api.multi
def write (self, vals):
if "finished_move_line_ids" in vals.keys():

id_move = self["move_finished_ids"]["id"]
qty = vals["finished_move_line_ids"][0][2]["qty_done"]
dominio = [('id', '=', id_move)]

move = self.env["stock.move"].search(dominio)
move.write({'ordered_qty': qty, 'product_uom_qty': qty})

res = super(mrp_production, self).write(vals)

return res


    #Avoid warning on consumed less than planned after increase product quantity
@api.multi
@api.depends
('move_raw_ids.quantity_done', 'move_raw_ids.product_uom_qty')
def _compute_consumed_less_than_planned(self):

for order in self:
order.consumed_less_than_planned = False
0
Avatar
Kassér
Avatar
Waldemar Tapia
Bedste svar

Try this alternative solution.


Create an indicator for lists of materials with variable production

You must put the components of the BOM by default 1.

Make the production fill the consumption and result.
By marking as a fact, the respective consumption and planned result is assigned
class MrpBom(models.Model):
_inherit = 'mrp.bom'
variable_result = fields.Boolean('Resultado Variable'
, default=False,
help="Si es verdadero, la cantidad de productos resultantes son variables y no dependen del consumo.")


class MrpProduction(models.Model):
_inherit = 'mrp.production'


@api.multi
def button_mark_done(self):
if self.bom_id.variable_result:
for move_raw in self.move_raw_ids:
qty = move_raw.quantity_done
move_raw.write({'product_uom_qty': qty}) #'ordered_qty': qty,

for move_line in self.finished_move_line_ids:
qty = move_line.qty_done
dominio = [('id', '=', move_line.move_id.id)]
move = self.env["stock.move"].search(dominio)
move.update({'ordered_qty': qty, 'product_uom_qty': qty})

# move_line.write({'product_uom_qty': qty}) #'ordered_qty': qty,

return super(MrpProduction, self).button_mark_done()


0
Avatar
Kassér
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Tilmeld dig
Related Posts Besvarelser Visninger Aktivitet
MRP for unitary production
production bom
Avatar
Avatar
2
feb. 19
3996
How to manage a component whose quantity does not depend on the production quantity of the product
manufacturing production bom
Avatar
0
jun. 25
2113
Products with optional upgrades
production bom variants
Avatar
0
jun. 21
2893
How to put the whole BOM into requests for quotation before starting a new production
purchase production bom
Avatar
2
okt. 17
4180
Bill of Materials costing
production bom costing
Avatar
Avatar
3
sep. 16
7711
Community
  • Tutorials
  • Dokumentation
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Oversættelser
Tjenester
  • Odoo.sh-hosting
  • Support
  • Opgradere
  • Individuelt tilpasset udvikling
  • Uddannelse
  • Find en bogholder
  • Find en partner
  • Bliv partner
Om os
  • Vores virksomhed
  • Brandaktiver
  • Kontakt os
  • Stillinger
  • Arrangementer
  • Podcast
  • Blog
  • Kunder
  • Juridiske dokumenter • Privatlivspolitik
  • Sikkerhedspolitik
الْعَرَبيّة 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 ภาษาไทย Türkçe українська Tiếng Việt

Odoo er en samling open source-forretningsapps, der dækker alle dine virksomhedsbehov – lige fra CRM, e-handel og bogføring til lagerstyring, POS, projektledelse og meget mere.

Det unikke ved Odoo er, at systemet både er brugervenligt og fuldt integreret.

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