Skip to content
Snippets Groups Projects
Commit 7fdec660 authored by Adrien Widart's avatar Adrien Widart
Browse files

[FIX] account_analytic_default: keep new account analytic


When importing some invoice lines, if the analytic account field of a
line has changed, the new invoice line will still keep the initial
analytic account value.

To reproduce the error:
(use demo data)
1. Create an invoice I01
    - Add one line with one analytic account (e.g., "Administrative")
2. Save
3. Go to Accounting > Customers > Invoices
4. Export I01:
    - Enable "I want to update data (import-compatible export)"
    - Fields to export:
        - Invoice lines
        - Invoice lines/External ID
        - Invoice lines/Analytic Account
        - Invoice lines/Analytic Account/Analytic Account
5. On exported file:
    - Delete column "invoice_line_ids"
    - Change the analytic account (e.g., "Operating Costs")
6. Import the file
7. Open I01

Error: The analytic account is still "Administrative". It should be
"Operating Costs".

The issue comes from both `._origin`: the module keeps the initial
values. Both `_origin` were introduced to fix an issue (see #49110), but
they are not useful anymore.

OPW-2452428

closes odoo/odoo#66433

Signed-off-by: default avatarAdrien Widart <adwid@users.noreply.github.com>
parent ca69537f
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment