Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4 ตอบกลับ
9145 มุมมอง

Hii,

I have a custom module that will create product pickings and moves...

In the module lines table there are product, qty, uom and lot information.

In a Confirm button I want to create records in the following tables,

stock.picking

stock.move

stock.move.line

Please guide how to create above records and what values to pass and business logic from python code.

Odoo Version 12 EE

Thanks


อวตาร
ละทิ้ง

Hope these customization tips will help: https://sites.google.com/view/thinkincode/erp/odoo

คำตอบที่ดีที่สุด

Please check this app. This may help you

https://apps.odoo.com/apps/modules/12.0/invoice_stock_move/

อวตาร
ละทิ้ง
คำตอบที่ดีที่สุด

Hi!

First, you have to check for each model what are the required fields

For create an record of an model, you have to create an object like this:

values_for_create = {

    'model_field_1': value_for_model_field_1,

     'model_field_2': value_for_model_field_2,

    ...

}

and after just add:

self.env['model_to_create_record'].create(values_for_create)

อวตาร
ละทิ้ง
ผู้เขียน

Hii Kévin Crisa,

Thank you for the reply. Just calling create methods and passing values will not work in this case. Creating pickings require many other tables to involve like procurement.group.

What I am looking for is how to create pickings with all required business logic covered.

Related Posts ตอบกลับ มุมมอง กิจกรรม
0
เม.ย. 24
1910
3
พ.ย. 23
2081
0
ธ.ค. 19
4612
5
ธ.ค. 19
3716
0
ส.ค. 19
4