Friday, June 16, 2023
2 changes · master
Resolved issues and error corrections
This fix ensures the Indian sales and purchase stock localization modules are correctly tied to the stock-related apps they rely on. If those stock apps are removed, the related Indian localization modules are removed too, preventing server errors when users open sales or purchase records.
Original PR description
* l10n_in_purchase_stock, l10n_in_sale_stock before this commit, if sale_stock or purchase_stock module was uninstalled from db manually, exception will be shown for the users. * create a db with…
* l10n_in_purchase_stock, l10n_in_sale_stock before this commit, if sale_stock or purchase_stock module was uninstalled from db manually, exception will be shown for the users. * create a db with selecting country as india for l10n_in_sale_stock: * install sale and stock module in the db * sale_stock and l10_in_sale_stock will get installed in the db * now uninstall sale_stock module, user will receive 500 internal server error as the l10_in_sale_stock didn't get uninstalled and depends on warehouse_id field from sale_stock module * in l10n_in_sale_stock module, _compute_l10n_in_journal_id function is depending on the field warehouse_id which is added from the sale_stock module Exception: ValueError: Wrong @Depends on _compute_l10n_in_journal_id (compute method of field sale.order.l10n_in_journal_id). Dependency field warehouse_id not found in model sale.order. for l10n_in_purchase_stock: * in fresh db, install purchase and stock module * purchase_stock, l10n_in_purchase_stock will get installed automatically * now uninstall purchase_stock module and try to open the purchase order form,user will get exception * l10_in_purchase_stock module is still installed and depending on a field picking_type_id from purchase_stock module * onchange function l10n_in_onchange_company_id isdepending and using field picking_type_id which is added from purchase_stock module Exception:AttributeError: purchase.order object has no attribute picking_type_id after this commit, on uninstalling sale_stock or purchase_stock module from the db will uninstall l10_in_sale_stock, l10_in_purchase_stock modules respectively. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
When users open translations from an existing record, Odoo now saves the record automatically before showing the translation window. This prevents confusing mismatches where translated text is saved but the main record still shows an older unsaved value.
Original PR description
- Be sure to have two languages installed; - Open a record with translations (product, for instance); - Modify the field with translation, from "apple" to "peach"; - Open the translation. - Modify…
- Be sure to have two languages installed; - Open a record with translations (product, for instance); - Modify the field with translation, from "apple" to "peach"; - Open the translation. - Modify the English term, from "peach" to "apricot"; - Save; Before this commit, the field on the record still shows "peach", you need to revert the changes to came back to "apricot" (the last modified term). This occurs because the record is not yet saved, but the translation is. This can create confusing behaviors. Note also, that there is a different behavior when clicking on a translation button between new record and existing records. The first one will ask to save the record before doing the translation, contrariwise, the last one will let you modify the translation without saving. In this commit, to avoid all confusion, and to be coherent between new record and existing record, and to be also coherent with the always save policy. We will save the record automatically before opening the translation dialog. part-of task-id 3179751