[FIX] account_analytic_default: multiple line erase

opw-2230833

* What are the steps to reproduce your issue?
1. Goto https://runbot.odoo.com/runbot and connect to latest enterprise
version
2. Create a vendor bill with with 2 invoice lines, both having an
analytic account.
3. Click save.
4. Click Edit
5. Change analytic account on 1 line.
6. Click save.

* What is the current behavior that you observe?
The other invoice line has it's analytic line resetted to default (null,
exept if analytic_account_default is used), even though that line was
not edited, by the user.

* What would be your expected behavior in this case?
No extra changes on lines that were not edited when saving the invoice.
I checked that if you comment out '_onchange_invoice_line_ids' method
from account.move this issue disappears, so maybe start looking for the
bug from there.

closes odoo/odoo#49174

X-original-commit: a3e9598a1d964675a545680c34ee87a6136ef71c
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
This commit is contained in:
william
2020-04-08 07:19:13 +00:00
parent d9a4f1a4fb
commit 2823a948b0
@@ -83,5 +83,5 @@ class AccountMoveLine(models.Model):
date=record.date_maturity,
company_id=record.move_id.company_id.id
)
record.analytic_account_id = record.analytic_account_id or rec.analytic_id
record.analytic_tag_ids = record.analytic_tag_ids or rec.analytic_tag_ids
record.analytic_account_id = (record._origin or record).analytic_account_id or rec.analytic_id
record.analytic_tag_ids = (record._origin or record).analytic_tag_ids or rec.analytic_tag_ids