Friday, December 1, 2023
1 change · 17.0
Enhancements to existing features
This update gives businesses more control over automatic data predictions when importing electronic invoices (EDI). Instead of automatically overwriting imported values, companies can now opt-out of automatic predictions and customize how products, accounts, and taxes are predicted based on their specific needs. This is particularly useful for Italian invoice imports where different fields require different prediction rules.
Original PR description
Odoo may allow prediction to occur when importing an EDI. i.e. predicting the product, account and taxes of each line. By default, those predictions will overwrite the actual value. Though it may be…
Odoo may allow prediction to occur when importing an EDI. i.e. predicting the product, account and taxes of each line. By default, those predictions will overwrite the actual value. Though it may be helpful in some cases, there should be a way to opt-out of the this automatic overwrite and to have a more flexible way to do those predictions. Here is how this is now possible: 1. With `disable_onchange_name_predictive` one can indicate their desire to opt-out of the prediction overwrite (i.e. the default behavior). 2. They can then use the `_predict_product`, `_predict_account`, `_predict_taxes` methods to create their own way of prediction. Placeholders for those were created to allow their use even if the prediction module isn't present. NB: As the module in charge of predictions (`account_accountant`) is not always installed the `edi_prediction_enabled` context key is used to indicate whether the prediction methods can be used or not. In the case of this fix, the key is setup in the `l10n_it_reports` module, as this module is always installed if `account_accountant` and `l10n_it` are installed. This way of predicting is useful for cases demanding a less generic approach to prediction. e.g. For the Italian EDI module the account of a line can be predicted without any limitation as it is not a value imported by the EDI. Whereas, its product and taxes should be predicted only if none were imported. opw-3201391 opw-3172035 Community PR: https://github.com/odoo/odoo/pull/144437 Forward-Port-Of: odoo/enterprise#51835 Forward-Port-Of: odoo/enterprise#38079