-
-
Notifications
You must be signed in to change notification settings - Fork 794
Description
Module
account_asset_management from 12.0 to 13.0 onward, after the fusion of the account.invoice/account.move tables.
Describe the bug
-
In V12.0,
account.moverecords created fromaccount.assetrecords use the asset's name -
In v13.0 onwards, the fusion of
account.move/account.invoicemean that both table follow the same sequence generator for new invoice/move numbers.
Fittingly, the_setup_move_datamethod used inasset_compute->_compute_entries->create_moveno longer sets thenamefield on newly createdaccount.moverecords. -
However,
account.moverecords created fromaccount.asset(using theCompute Assetsaction) in the version 12.0 can mess with the sequence number generation - Indeed, from Odoo 14.0, the_deduce_sequence_number_resettries to extrapolate the sequence number format by taking an existing move in the journal.
If the createdaccount.moveis not a refund, it looks foraccount.movein the same journal,which are not ofout_refundandin_refund, which incluesentrymoves created from assets, that can have non-standard names if created in previous Odoo versions.
That causes aValidationErrorsince the name is not standard
(see the_deduce_sequence_number_resetmethod inodoo/addons/account/models/account_move.py)
To Reproduce
Affected versions: 14.0 onwards
Steps to reproduce the behavior:
- Create a v12.0 database
- Create assets and moves related to these assets
- Migrated the database to v14.0
- Try to use the Compute Assets action
Expected behavior
The account.move entities created from account.asset in previous Odoo versions, which do not possess standard sequence number names, shouldn't bar the creation of new account.move entities when the database is migrated.
I'm not sure if people have already surrounded the issue (renamed account.move records, simply didn't compute assets before a migration), but I'm interested in people's suggestions which might have migrated an Odoo database with the same module.