Skip to Content
Menu
This question has been flagged

Hi

I am trying to generate a manufacturing order using XMLRPC API. 

This is the python code I used to generate a M.O.

##create a new M.O.
models.execute_kw(db, uid, password, 'mrp.production', 'create',
[{'product_id':1579,
'company_id':1,
'consumption': 'warning',
'consumption': 'flexible',
'date_planned_start': '2021-08-01 09:00:00',
'location_dest_id': 8,
'location_src_id': 8,
'picking_type_id': 13,
'product_qty':1,
'product_uom_id':1}])


Note at this point no components were added yet.

The M.O. is generated fine (as draft), and I can view and open it in Odoo manufacturing App (web interface.)

However after I have added a component, confirmed it and then Marked it as Done, a validation error pops up saying "The quantity to produce must be positive". I just want to clarify that I do have the positive quantity displayed in the UI.

If I tried to create the MO using the web interface (without using XMLRPC API), everything works fine.

Has anyone had the same issue?


Cheers

Yuan

Avatar
Discard
Best Answer

There are two quantity fields: product_qty = Planned to produce.

qty_producing = Actually produced.   If this field =0, you get that message.

Avatar
Discard
Best Answer

Have a similar issue when not creating using the Web Interface. Have you managed to resolve?

Avatar
Discard

I'm also facing the issue when not creating using the web interface directly, do you already solved this issue?

Related Posts Replies Views Activity
3
Jan 23
4834
1
Mar 22
3580
1
Feb 22
3829
1
Jul 20
7816
0
Jan 24
358