Skip to Content
Odoo मेन्यू
  • Sign in
  • मुफ़्त में आज़माएं
  • ऐप्लिकेशन
    फ़ाइनेंस
    • अकाउंटिंग
    • इनवॉइसिंग
    • एक्सपेंस
    • स्प्रेडशीट (बीआई)
    • डॉक्यूमेंट्स
    • साइन
    सेल्स
    • सीआरएम
    • सेल्स
    • पीओएस शॉप
    • पीओएस रेस्टोरेंट
    • सब्सक्रिप्शन
    • रेंटल
    वेबसाइट
    • वेबसाइट बिल्डर
    • ई-कॉमर्स
    • ब्लॉग
    • फ़ोरम
    • लाइव चैट
    • ई-लर्निंग
    सप्लाई चेन
    • इन्वेंट्री
    • मैन्युफ़ैक्चरिंग
    • पीएलएम
    • परचेज़
    • मेंटेनेंस
    • क्वालिटी
    मानव संसाधन
    • कर्मचारी
    • रिक्रूटमेंट
    • टाइम ऑफ़
    • अप्रेज़ल
    • रेफ़रल
    • फ़्लीट
    मार्केटिंग
    • सोशल मार्केटिंग
    • ईमेल मार्केटिंग
    • एसएमएस मार्केटिंग
    • इवेंट
    • मार्केटिंग ऑटोमेशन
    • सर्वे
    सेवाएं
    • प्रोजेक्ट
    • टाइमशीट
    • फ़ील्ड सर्विस
    • हेल्पडेस्क
    • प्लानिंग
    • अपॉइंटमेंट
    प्रॉडक्टिविटी
    • डिस्कस
    • अप्रूवल
    • आईओटी
    • वीओआईपी
    • नॉलेज
    • WhatsApp
    तीसरे पक्ष के ऐप्लिकेशन Odoo स्टूडियो Odoo क्लाउड प्लेटफ़ॉर्म
  • इंडस्ट्री
    रीटेल
    • बुक स्टोर
    • क्लोदिंग स्टोर
    • फ़र्नीचर स्टोर
    • ग्रॉसरी स्टोर
    • हार्डवेयर स्टोर
    • टॉय स्टोर
    Food & Hospitality
    • बार और पब
    • रेस्टोरेंट
    • फ़ास्ट फ़ूड
    • Guest House
    • बेवरिज डिस्ट्रीब्यूटर
    • होटल
    रियल एस्टेट
    • Real Estate Agency
    • आर्किटेक्चर फ़र्म
    • कंसट्रक्शन
    • एस्टेट मैनेजमेंट
    • गार्ड्निंग
    • प्रॉपर्टी ओनर असोसिएशन
    कंसल्टिंग
    • अकाउंटिंग फ़र्म
    • Odoo पार्टनर
    • मार्केटिंग एजेंसी
    • लॉ फ़र्म
    • टैलेंट ऐक्विज़िशन
    • ऑडिट & सर्टिफ़िकेशन
    मैन्युफ़ैक्चरिंग
    • टेक्सटाइल
    • Metal
    • फ़र्नीचर
    • फ़ूड
    • Brewery
    • कॉर्पोरेट गिफ़्ट
    हेल्थ & फिटनेस
    • स्पोर्ट्स क्लब
    • आईवियर स्टोर
    • फिटनेस सेंटर
    • वेलनेस प्रैक्टिशनर
    • फॉर्मेसी
    • हेयर सैलून
    Trades
    • Handyman
    • आईटी हॉर्डवेयर और सपोर्ट
    • Solar Energy Systems
    • Shoe Maker
    • Cleaning Services
    • HVAC Services
    अन्य
    • Nonprofit Organization
    • एन्वायरमेंटल एजेंसी
    • बिलबोर्ड रेंटल
    • फ़ोटोग्राफी
    • बाइक लीजिंग
    • सॉफ़्टवेयर रीसेलर
    Browse all Industries
  • कम्यूनिटी
    सीखें
    • ट्यूटोरियल्स
    • दस्तावेज़
    • सर्टिफ़िकेशन
    • ट्रेनिंग
    • ब्लॉग
    • पॉडकास्ट
    शिक्षा को बढ़ावा दें
    • एजुकेशन प्रोग्राम
    • स्केल अप! बिजनेस गेम
    • Odoo के ऑफ़िस में आएं
    सॉफ़्टवेयर पाएं
    • डाउनलोड
    • वर्शन की तुलना करें
    • रिलीज़
    साथ मिलकर काम करें
    • Github
    • फ़ोरम
    • इवेंट
    • अनुवाद
    • पार्टनर बनें
    • Services for Partners
    • अपना अकाउंटिंग फ़र्म रजिस्टर करें
    सेवाएं पाएं
    • पार्टनर ढूंढें
    • अकाउंटेंट खोजें
    • सलाहकार की मदद लें
    • इम्प्लिमेंटेशन सेवाएं
    • कस्टमर रेफ़रेंस
    • सहायता
    • अपग्रेड
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    डेमो देखें
  • कीमत
  • सहायता

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

  • सीआरएम
  • e-Commerce
  • लेखांकन
  • इन्वेंटरी
  • PoS
  • प्रोजेक्ट
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
टैग (View all)
odoo accounting v14 pos v15
About this forum
Help

How to create manufacturing order using API?

Subscribe

Get notified when there's activity on this post

This question has been flagged
apibomManufacturing Order
2 Replies
10907 Views
Avatar
Ruben Agadzanjans

I'm trying to create a manufacturing order using API. I can create a new order, but it doesn't have any components. The bom I'm using has components defined, by they are not populated when this manufacturing order is created.

Here is how I'm creating it: 

models.execute_kw(db, uid, password, 
'mrp.production', 'create', [{
  product_id: 69,
  bom_id: 9,
  product_uom_id: 1,
}]
)
Thanks!
0
Avatar
Discard
Cody Kinzett

Hey there, did you work this out? I am facing the same issue. I can create the MO but cannot proceed as it has no components, I believe the stock.move has something to do with it. as this line is in mrp_production.py

move_raw_ids = fields.One2many(

'stock.move', 'raw_material_production_id', 'Components',

copy=True, states={'done': [('readonly', True)], 'cancel': [('readonly', True)]},

domain=[('scrapped', '=', False)])

Ruben Agadzanjans
Author

I ended up using python to create manufacturing order.

Here is what I do:

```

bom_description = self.get_bom_description(product_id)

manufacturing_order = self.env['mrp.production'].create([{

'product_id': product_id,

'product_qty': 1,

'product_uom_qty': 1,

'qty_produced': 1,

'product_uom_id': bom_description['product_uom_id'][0],

'bom_id': bom_description['bom_id'][0],

'origin': origin,

'move_finished_ids': [

[0, '', {

'product_id': move_finished_id[2]['product_id'][0],

'product_uom': move_finished_id[2]['product_uom'][0],

'product_uom_qty': move_finished_id[2]['product_uom_qty'],

'location_id': move_finished_id[2]['location_id'][0],

'location_dest_id': destination_location.id,

'name': move_finished_id[2]['name'],

'byproduct_id': False,

}]

for move_finished_id in bom_description['move_finished_ids'][1:]

],

'move_raw_ids': [

[0, '', {

'product_id': move_raw_id[2]['product_id'][0],

'bom_line_id': move_raw_id[2]['bom_line_id'][0],

'product_uom': move_raw_id[2]['product_uom'][0],

'product_uom_qty': move_raw_id[2]['product_uom_qty'],

'location_id': part_source_location.id,

'location_dest_id': move_raw_id[2]['location_dest_id'][0],

'name': move_raw_id[2]['name'],

}]

for move_raw_id in bom_description['move_raw_ids'][1:]

]

}])

manufacturing_order.action_confirm()

manufacturing_order.update({'lot_producing_id': lot.id})

immediate_production = self.env['mrp.immediate.production'].create({

'immediate_production_line_ids': [[0, '', {

'production_id': manufacturing_order.id,

'to_immediate': True

}]]

})

immediate_production.process()

manufacturing_order.button_mark_done()

def get_bom_description(self, product_id):

onchange_res = self.env['mrp.production'].onchange(

{

'product_id': product_id,

},

'product_id',

{

'company_id': '1',

'product_id': '1',

'product_qty': '1',

'product_uom_id': '1',

'bom_id': '1',

'move_finished_ids': '1',

'move_finished_ids.product_id': '1',

'move_finished_ids.product_uom': '1',

'move_finished_ids.product_uom_qty': '1',

'move_finished_ids.location_id': '1',

'move_finished_ids.location_dest_id': '1',

'move_finished_ids.name': '',

'move_raw_ids': '1',

'move_raw_ids.product_id': '1',

'move_raw_ids.name': '',

'move_raw_ids.bom_line_id': '',

'move_raw_ids.location_id': '1',

'move_raw_ids.location_dest_id': '1',

'move_raw_ids.product_uom_qty': '1',

'move_raw_ids.product_uom': '1',

}

)

return onchange_res['value']

```

Same thing can be done using API. The important part for me was that I needed to call [mrp.production].onchange to get information about all components from the bom and then pass them in as move_finished_ids and move_raw_ids.

Avatar
Ruben Agadzanjans
Author Best Answer

I ended up using python to create manufacturing order.

Here is what I do:

    def assemble_product(self, product_id, part_source_location, destination_location, origin=None):
bom_description = self.get_bom_description(product_id)
manufacturing_order = self.env['mrp.production'].create([{
'product_id': product_id,
'product_qty': 1,
'product_uom_qty': 1,
'qty_produced': 1,
'product_uom_id': bom_description['product_uom_id'][0],
'bom_id': bom_description['bom_id'][0],
'origin': origin,
'move_finished_ids': [
[0, '', {
'product_id': move_finished_id[2]['product_id'][0],
'product_uom': move_finished_id[2]['product_uom'][0],
'product_uom_qty': move_finished_id[2]['product_uom_qty'],
'location_id': move_finished_id[2]['location_id'][0],
'location_dest_id': destination_location.id,
'name': move_finished_id[2]['name'],
'byproduct_id': False,
}]
for move_finished_id in bom_description['move_finished_ids'][1:]
],
'move_raw_ids': [
[0, '', {
'product_id': move_raw_id[2]['product_id'][0],
'bom_line_id': move_raw_id[2]['bom_line_id'][0],
'product_uom': move_raw_id[2]['product_uom'][0],
'product_uom_qty': move_raw_id[2]['product_uom_qty'],
'location_id': part_source_location.id,
'location_dest_id': move_raw_id[2]['location_dest_id'][0],
'name': move_raw_id[2]['name'],
}]
for move_raw_id in bom_description['move_raw_ids'][1:]
]
}])
manufacturing_order.action_confirm()
immediate_production = self.env['mrp.immediate.production'].create({
'immediate_production_line_ids': [[0, '', {
'production_id': manufacturing_order.id,
'to_immediate': True
}]]
})
immediate_production.process()
manufacturing_order.button_mark_done()

def get_bom_description(self, product_id):
onchange_res = self.env['mrp.production'].onchange(
{
'product_id': product_id,
},
'product_id',
{
'company_id': '1',
'product_id': '1',
'product_qty': '1',
'product_uom_id': '1',
'bom_id': '1',
'move_finished_ids': '1',
'move_finished_ids.product_id': '1',
'move_finished_ids.product_uom': '1',
'move_finished_ids.product_uom_qty': '1',
'move_finished_ids.location_id': '1',
'move_finished_ids.location_dest_id': '1',
'move_finished_ids.name': '',
'move_raw_ids': '1',
'move_raw_ids.product_id': '1',
'move_raw_ids.name': '',
'move_raw_ids.bom_line_id': '',
'move_raw_ids.location_id': '1',
'move_raw_ids.location_dest_id': '1',
'move_raw_ids.product_uom_qty': '1',
'move_raw_ids.product_uom': '1',
}
)
return onchange_res['value']

def assemble_product_with_serial_number(self, product_id, serial_number, part_source_location, destination_location, origin=None):
if not serial_number:
raise UserError('non-empty serial_number must be provided')

_logger.info(f'Assembling: {serial_number}')

lot_name = serial_number
existing_lot = self.env['stock.production.lot'].search([('name', '=', lot_name)], limit=1)
if existing_lot and existing_lot.product_qty > 0:
raise UserError(f'Device with serial number {lot_name} already exists')

lot = existing_lot or self.env['stock.production.lot'].create({
'product_id': product_id,
'name': lot_name,
'company_id': self.env.company.id
})

bom_description = self.get_bom_description(product_id)
manufacturing_order = self.env['mrp.production'].create([{
'product_id': product_id,
'product_qty': 1,
'product_uom_qty': 1,
'qty_produced': 1,
'product_uom_id': bom_description['product_uom_id'][0],
'bom_id': bom_description['bom_id'][0],
'origin': origin,
'move_finished_ids': [
[0, '', {
'product_id': move_finished_id[2]['product_id'][0],
'product_uom': move_finished_id[2]['product_uom'][0],
'product_uom_qty': move_finished_id[2]['product_uom_qty'],
'location_id': move_finished_id[2]['location_id'][0],
'location_dest_id': destination_location.id,
'name': move_finished_id[2]['name'],
'byproduct_id': False,
}]
for move_finished_id in bom_description['move_finished_ids'][1:]
],
'move_raw_ids': [
[0, '', {
'product_id': move_raw_id[2]['product_id'][0],
'bom_line_id': move_raw_id[2]['bom_line_id'][0],
'product_uom': move_raw_id[2]['product_uom'][0],
'product_uom_qty': move_raw_id[2]['product_uom_qty'],
'location_id': part_source_location.id,
'location_dest_id': move_raw_id[2]['location_dest_id'][0],
'name': move_raw_id[2]['name'],
}]
for move_raw_id in bom_description['move_raw_ids'][1:]
]
}])
manufacturing_order.action_confirm()
manufacturing_order.update({'lot_producing_id': lot.id})
immediate_production = self.env['mrp.immediate.production'].create({
'immediate_production_line_ids': [[0, '', {
'production_id': manufacturing_order.id,
'to_immediate': True
}]]
})
immediate_production.process()
manufacturing_order.button_mark_done()
_logger.info(f'Completed Manufacturing Order {manufacturing_order.name}')

return self.env['stock.production.lot'].browse(lot.id)



Same thing can be done using API. The important part for me was that I needed to call [mrp.production].onchange to get information about all components from the bom and then pass them in as move_finished_ids and move_raw_ids.

(edit: added example for assembling a product with serial number)
1
Avatar
Discard
Cody Kinzett

Awesome thank you for the script! this works as needed, i don't think i would have ever worked this out! I would mark your answer as the correct answer as i'm sure people will look for this in the future!

Ray Carnes (ray)

A way to get access to the "secret" API calls you need is explained https://www.odoo.com/forum/help-1/how-can-i-see-which-api-calls-are-made-to-learn-what-odoo-is-doing-at-specific-times-183911

Cody Kinzett

Another quick question if you have any suggestions, it works great for products that dont need a Serial/Lot ID but gives me an error for products that do need a lot.

i can generate a randomised serial using the commented code, manufacturing_order.action_generate_serial()

but id really like to use the Lot_id provided by the user to create the lot.

ive tried passing 'lot_producing_id' and it actually appears in the produced MO's but i must be missing a variable or prior function because the MO's cannot be advanced to 'Done' even if you change to a different/create a new Serial on the Manufacturing order direclty. it always says user Error a lot/serial number must be supplied.

ive also tried passing 'Lot_Ids' ,'order_finished_lot_ids' on the 'move_finished_ids' variable but this doesnt help or progress it in any way...

wondering if i pass a var in the XML. as i have seen some Xpath solutions.

Code is :::

Lot_id = self.env['stock.production.lot'].create({

'name': self.Serial_Number,

'product_id': WIP_check,

'company_id': company,

})

## https://www.odoo.com/forum/help-1/how-to-create-manufacturing-order-using-api-182874

bom_description = self.get_bom_description(WIP_check)

print('str(self.package_qty)',str(self.package_qty))

manufacturing_order = self.env['mrp.production'].create([{

'product_id': WIP_check,

'product_qty': str(self.package_qty),

'product_uom_id': bom_description['product_uom_id'][0],

'qty_producing': self.package_qty,

'product_uom_qty': str(self.package_qty),

'bom_id': bom_description['bom_id'][0],

'origin': self.reference,

'location_src_id': Source_Location,

'lot_producing_id': Lot_id.id,

'move_finished_ids': [

[0, '', {

'product_id': move_finished_id[2]['product_id'][0],

'product_uom': move_finished_id[2]['product_uom'][0],

'product_uom_qty': str(int(move_finished_id[2]['product_uom_qty'])*int(self.package_qty)),

'location_id': move_finished_id[2]['location_id'][0],

'location_dest_id': move_finished_id[2]['location_dest_id'][0],

'name': move_finished_id[2]['name'],

'byproduct_id': False,

'quantity_done': str(int(move_finished_id[2]['product_uom_qty']) * int(self.package_qty)),

}]

for move_finished_id in bom_description['move_finished_ids'][1:]

],

'move_raw_ids': [ [0, '', {

'product_id': move_raw_id[2]['product_id'][0],

'bom_line_id': move_raw_id[2]['bom_line_id'][0],

'product_uom': move_raw_id[2]['product_uom'][0],

'product_uom_qty': str(int(move_raw_id[2]['product_uom_qty'])*int(self.package_qty)),

'location_id': Source_Location,

'location_dest_id':Source_Location,

'name': move_raw_id[2]['name'],

'quantity_done': str(int(move_raw_id[2]['product_uom_qty']) * int(self.package_qty)),

}]

for move_raw_id in bom_description['move_raw_ids'][1:]

]

}])

manufacturing_order.action_confirm()

# manufacturing_order.action_generate_serial()

manufacturing_order.action_assign()

manufacturing_order.button_mark_done()

def get_bom_description(self, product_id):

onchange_res = self.env['mrp.production'].onchange(

{

'product_id': product_id

},

'product_id',

{

'company_id': '1',

'product_id': '1',

'product_qty': '1',

'product_uom_id': '1',

'bom_id': '1',

'move_finished_ids': '1',

'move_finished_ids.product_id': '1',

'move_finished_ids.product_uom': '1',

'move_finished_ids.product_uom_qty': '1',

'move_finished_ids.location_id': '1',

'move_finished_ids.location_dest_id': '1',

'move_finished_ids.name': '',

'move_raw_ids': '1',

'move_raw_ids.product_id': '1',

'move_raw_ids.name': '',

'move_raw_ids.bom_line_id': '',

'move_raw_ids.location_id': '1',

'move_raw_ids.location_dest_id': '1',

'move_raw_ids.product_uom_qty': '1',

'move_raw_ids.product_uom': '1',

}

)

return onchange_res['value']

Cody Kinzett

also @ray i setup this and it is helpful, but when i compare my code running to odoo code manufacturing i see the same thing.

working MO : 'lot_producing_id': (185, '0000011'),

my test : 'lot_producing_id': (195, '207'),

when I look at PGadmin i can see the lot_producing_id in the correct table.

select * from mrp_production mp

inner join

stock_production_lot spl

on

mp.lot_producing_id = spl.id;

my lack of odoo understanding and where to find solutions is the issue hahahah.

im not sure which triggers run when Odoo runs its own MO because from what i can tell im doing the right things.

Ive found a ton of your answers for automating stuff using auto assigned Lots but unfortunately not much for user assigned lots.

Hoping your expertise will come in handy here

Ruben Agadzanjans
Author

I've edited the answer to add another example for manufacturing a product with a serial number

Cody Kinzett

Thank you Ruben very professional! I hope to be as skilled as you someday! any advice on how to learn to reverse engineer Odoo so I can learn how to do this myself?

Ruben Agadzanjans
Author

It took me around three months to figure this out and to implement odoo in our organization. Basically I had to read a lot of the source code to understand how it works (e.g. https://github.com/odoo/odoo/tree/14.0/addons/mrp/models). I also inspect what calls are made by the odoo UI and that gives me an idea of where to look at.

Cody Kinzett

A little extra. this code will consume products where lot assignment is turned on for consumed goods. thanks to Ray and Ruben for the advice that got me there.

def assemble_product_with_serial_number(self):

lot_name = self.Serial_Number

existing_lot = self.env['stock.production.lot'].search([('name', '=', lot_name)], limit=1)

if existing_lot and existing_lot.product_qty > 0:

raise exceptions.UserError(f'Device with serial number {lot_name} already exists')

lot = existing_lot or self.env['stock.production.lot'].create({

'product_id': WIP_check,

'name': lot_name,

'company_id': self.env.company.id

})

bom_description = self.get_bom_description(WIP_check)

for move_finished_id in bom_description['move_finished_ids']:

print(move_finished_id)

manufacturing_order = self.env['mrp.production'].create([{

'product_id': WIP_check,

'product_qty': str(self.package_qty),

'product_uom_qty': 1,

'product_uom_id': bom_description['product_uom_id'][0],

'bom_id': bom_description['bom_id'][0],

'origin': self.reference,

'location_src_id': Source_Location,

'move_finished_ids': [

[0, '', {

'product_id': move_finished_id[2]['product_id'][0],

'product_uom': move_finished_id[2]['product_uom'][0],

'product_uom_qty': str(int(move_finished_id[2]['product_uom_qty'])*int(self.package_qty)),

'location_id': move_finished_id[2]['location_id'][0],

'location_dest_id': Source_Location,

'name': move_finished_id[2]['name'],

'byproduct_id': False,

}]

for move_finished_id in bom_description['move_finished_ids'][1:]

],

'move_raw_ids': [

[0, '', {

'product_id': move_raw_id[2]['product_id'][0],

'bom_line_id': move_raw_id[2]['bom_line_id'][0],

'product_uom': move_raw_id[2]['product_uom'][0],

'product_uom_qty': str(int(move_raw_id[2]['product_uom_qty'])*int(self.package_qty)),

'location_id': Source_Location,

'location_dest_id': move_raw_id[2]['location_dest_id'][0],

'name': move_raw_id[2]['name'],

}]

for move_raw_id in bom_description['move_raw_ids'][1:]

]

}])

manufacturing_order.action_confirm()

# get actual lot ID's in WIP, - how to handle half lots?

# get actual consumption value - DONE

tracking=[]

for raw_ids in bom_description['move_raw_ids'][1:]:

if raw_ids[2]['has_tracking'] != 'none':

sm = self.env['stock.move'].search([('reference', '=', manufacturing_order.name),('product_id','=',raw_ids[2]['product_id'][0])])

self._cr.execute("""

select

lot_id,

sq.quantity,

reserved_quantity,

sl.complete_name

from

stock_quant sq

inner join

stock_location sl

on

sq.location_id = sl.id

inner join

stock_move sm

on

sl.id = sm.location_id

and

sq.product_id = sm.product_id

where

sl.complete_name like %s

and

sm.id = %s

and

lot_id is not null

""",

('%WIP%',sm.id))

Lots_Avail_in_WIP = self._cr.fetchall()

product_to_consume = int(self.package_qty)

for lot_id, sq_quantity, reserved_quantity, sl_complete_name in Lots_Avail_in_WIP:

print('--', lot_id, sq_quantity, reserved_quantity, sl_complete_name)

print('--int(raw_ids[2][product_uom_qty]) * product_to_consume',int(raw_ids[2]['product_uom_qty']) * product_to_consume)

if sq_quantity < 1:

continue

elif sq_quantity > int(raw_ids[2]['product_uom_qty']) * product_to_consume:

print('---Enough goods for single lot consumption')

self.env['stock.move'].search([('id', '=', sm.id)]).update({'lot_ids': [lot_id],

'product_uom_qty': str(int(raw_ids[2]['product_uom_qty'])*product_to_consume),

'quantity_done': str(int(raw_ids[2]['product_uom_qty'])*product_to_consume),

'should_consume_qty': str(int(raw_ids[2]['product_uom_qty'])*product_to_consume),

})

break

else:

#to be completed

print('---not enough goods for single lot consumption')

self.env['stock.move'].search([('id', '=', sm.id)]).update({'lot_ids': [lot_id],

'product_uom_qty': str(int(

raw_ids[2][

'product_uom_qty']) * product_to_consume),

'quantity_done': str(int(raw_ids[2][

'product_uom_qty']) * product_to_consume),

'should_consume_qty': str(int(

raw_ids[2][

'product_uom_qty']) * product_to_consume),

})

product_to_consume -= sq_quantity

manufacturing_order.update({'lot_producing_id': lot.id})

immediate_production = self.env['mrp.immediate.production'].create({

'immediate_production_line_ids': [[0, '', {

'production_id': manufacturing_order.id,

'to_immediate': True

}]]

})

immediate_production.process()

manufacturing_order.button_mark_done()

_logger.info(f'Completed Manufacturing Order {manufacturing_order.name}')

Avatar
Andrei Dobrescu
Best Answer

Hello,

The easisest way I could find is to trigger these methods:

  record._onchange_move_raw()

  record._onchange_move_finished_product()

  record._onchange_workorder_ids()

It should deliver everything needed for the BoM.


Cheers,

Andrei

0
Avatar
Discard
Enjoying the discussion? Don't just read, join in!

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

Sign up
Related Posts Replies Views Activity
Single MO Creates 3 Products 13.0 Solved
bom Manufacturing Order
Avatar
2
जन॰ 20
3380
How to know when to order inventory to fulfil Manufacturing Orders? Solved
bom Manufacturing Order
Avatar
Avatar
Avatar
Avatar
6
अक्तू॰ 18
6646
Show SO availability from BoM components for Make-To-Order repairs (need MO)
bom Manufacturing Order sales order
Avatar
Avatar
1
अक्तू॰ 25
442
Start manufacturing with available components
bom subprocess Manufacturing Order
Avatar
0
मार्च 23
2494
Produce multiple items from one manufacturing order
manufacturing bom Manufacturing Order
Avatar
Avatar
1
मई 22
6200
कम्यूनिटी
  • ट्यूटोरियल्स
  • दस्तावेज़
  • फ़ोरम
ओपन सोर्स
  • डाउनलोड
  • Github
  • रनबॉट
  • अनुवाद
सेवाएं
  • Odoo.sh Hosting
  • सहायता
  • अपग्रेड
  • कस्टम डेवलपमेंट्स
  • शिक्षा
  • अकाउंटेंट खोजें
  • पार्टनर ढूंढें
  • पार्टनर बनें
हमारे बारे में
  • हमारी कंपनी
  • ब्रांड ऐसेट
  • संपर्क करें
  • नौकरियां
  • इवेंट
  • पॉडकास्ट
  • ब्लॉग
  • ग्राहक
  • लीगल • गोपनीयता
  • सुरक्षा
الْعَرَبيّة 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, बिज़नेस से जुड़े ऐप्लिकेशन का एक कलेक्शन है जो ओपन सोर्स पर आधारित है. इसमें आपकी कंपनी की हर ज़रूरत के लिए ऐप्लिकेशन हैं. जैसे, सीआरएम, ई-कॉमर्स, अकाउंटिंग, इन्वेंट्री, पॉइंट ऑफ़ सेल, प्रोजेक्ट मैनेजमेंट वगैरह.

Odoo की सबसे बड़ी खासियत है कि यह इस्तेमाल करने में बहुत आसान है और यह पूरी तरह से इंटिग्रेट किया हुआ है.

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