odoo/odoo#199503

Created by fw-bot
Merged at 1f26e5e849f3b27485d8a3f802fe2b3b74ba91c9

Statuses:

label
odoo-dev:18.0-17.0-account-fix-anglo-saxon-accounting-bona-419067-fw
head
9c0c4fa412fe1e922e1057fd4e463480991201f5
merged
7 months ago by Accounting, John Laterre (jol)
odoo/odoo
17.0 #198011
saas-17.4 #199491
18.0 #199503
saas-18.1 #199512
saas-18.2 #199521
saas-18.3
saas-18.4
19.0
master #199525

[FW][FIX] account: consider customer value for anglo_saxon_accounting

steps to reproduce:

  1. Install a localization module that does not use anglo_saxon_accounting in 17.0 (Ex:l10n_in)
  2. Enable the "Anglo-Saxon Accounting" option.
  3. Migrate to 18.0 version.

Issue:

Commit c2d0251 , sets a default value when changing the CoA. However,
during migration, when the _pre_load_data function runs, it overrides the
customer's selection even if the CoA is not changed and assigns the default
value to the anglo_saxon_accounting field, ignoring the customer's preference.

Original DB:

bona_2515224=> select id,name,anglo_saxon_accounting from res_company;
 id |              name              | anglo_saxon_accounting 
----+--------------------------------+------------------------
  6 | Handful of Health Pvt Ltd - TN | t
  4 | Handful of Health Pvt Ltd - KA | t
  8 | Handful of Health Pvt Ltd - GJ | t
  2 | Handful of Health Pvt Ltd - MH | t
  7 | Handful of Health Pvt Ltd - GA | t
  5 | Handful of Health Pvt Ltd - RJ | t
  3 | Handful of Health Pvt Ltd - UP | t
  1 | Handful of Health Pvt Ltd - DL | t
(8 rows)

Without fix:

bona_2515224_upg=> select id,name,anglo_saxon_accounting from res_company;
 id |              name              | anglo_saxon_accounting 
----+--------------------------------+------------------------
  1 | Handful of Health Pvt Ltd - DL | f
  2 | Handful of Health Pvt Ltd - MH | f
  3 | Handful of Health Pvt Ltd - UP | f
  4 | Handful of Health Pvt Ltd - KA | f
  5 | Handful of Health Pvt Ltd - RJ | f
  6 | Handful of Health Pvt Ltd - TN | f
  7 | Handful of Health Pvt Ltd - GA | f
  8 | Handful of Health Pvt Ltd - GJ | f
(8 rows)

With fix:

bona_2515224_18.0=> select id,name,anglo_saxon_accounting from res_company;
 id |              name              | anglo_saxon_accounting 
----+--------------------------------+------------------------
  7 | Handful of Health Pvt Ltd - GA | t
  8 | Handful of Health Pvt Ltd - GJ | t
  4 | Handful of Health Pvt Ltd - KA | t
  2 | Handful of Health Pvt Ltd - MH | t
  5 | Handful of Health Pvt Ltd - RJ | t
  6 | Handful of Health Pvt Ltd - TN | t
  3 | Handful of Health Pvt Ltd - UP | t
  1 | Handful of Health Pvt Ltd - DL | t
(8 rows)

opw-4542300


I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

Forward-Port-Of: #198011