[FIX] mrp_account: copy analytic account when duplicating a BoM

Steps to reproduce the bug:
- Install mrp_plm
- Create a BoM with an analytic account
- Create an ECO
- Start the revision

Problem:
The new BoM version doesn't have the analytic account from the original
one.

opw-3329901

closes odoo/odoo#125111

X-original-commit: 0210980037ccf843d73033d2a240369112899ff1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
This commit is contained in:
Touati Djamel (otd)
2023-06-15 13:33:40 +02:00
parent 4f3e1af489
commit 44509d46f3
+1 -1
View File
@@ -6,5 +6,5 @@ from odoo import fields, models
class MrpBom(models.Model):
_inherit = 'mrp.bom'
analytic_account_id = fields.Many2one('account.analytic.account', 'Analytic Account', company_dependent=True,
analytic_account_id = fields.Many2one('account.analytic.account', 'Analytic Account', company_dependent=True, copy=True,
help="Analytic account in which cost and revenue entries will take place for financial management of the manufacturing order.")