Hi everybody,
How can I merge sale order line in Odoo programmatically? I have duplicated products in sale order line. Now I want to remove duplicate products but merge the quantity.
Thank you
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hi everybody,
How can I merge sale order line in Odoo programmatically? I have duplicated products in sale order line. Now I want to remove duplicate products but merge the quantity.
Thank you
Hello,
You have to use the for loop for order line and check the for the products, if you found any product repeated the merge the quantity and update the line.
Hello Odoo learner,
Please find code in comment.
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Try this code on a button click:
for line in self.order_line:
if line.id in self.order_line.ids:
line_ids = self.order_line.filtered(lambda m: m.product_id.id == line.product_id.id)
quantity = 0
for qty in line_ids:
quantity += qty.product_uom_qty
line_ids[0].write({'product_uom_qty': quantity, 'order_id': line_ids[0].order_id.id})
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
2
Okt 25
|
2557 | ||
|
1
Sep 25
|
2546 | ||
|
3
Jul 25
|
4000 | ||
|
1
Mei 25
|
2113 | ||
|
4
Mei 25
|
3448 |