Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
5552 Lượt xem

Hi,


Let's say I have an object/model with 1-Many related lines and I want to copy those to another model with the same 1-Many line.  For example: I want to copy a sale order + it's related sale order lines => to an invoice with invoice lines, where the invoice lines are the same items/products as in the sale order.

How can I do this in Odoo 12 using Odoo Studio and/or a server or automated action? 

Kind regards,

Bas

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You could create an automated action that triggers every time a sale order is created. On this automated action you would first create the parent record, i.e. the invoice. Then you would recreate the line items, i.e. invoice lines, and set the many2one relation to your previously created parent object.

I think you'd have to write python for this, since you need to assign the created line items to the newly created parent record.

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 10 24
2963
2
thg 10 24
4834
0
thg 9 24
1250
2
thg 8 24
1397
0
thg 1 25
1251