summaryrefslogtreecommitdiff
path: root/addons/test_base_automation
AgeCommit message (Collapse)Author
2021-03-16[FIX] base_automation: mis-ordered computation of stored fieldsXavier Morel
Client issue: when updating the company of a contact, the Display Name keeps using the previous company's name, so given Bob in company A, if Bob is moved to company B the form's title remains "A, Bob" instead of becoming "B, Bob". More annoying, if Bob is moved back to A the name becomes "B, Bob". On res.partner, `display_name` is a stored computed field which depends on `commercial_company_name` (via `name_get` -> `_get_name` -> `_get_contact_name`). This is an other stored computed name, which depends on `commercial_partner_id`, which is yet another stored computed name, which depends on the `parent_id`. The dependencies are meh but usually resolve fine, the issue occurs when a base.automation rule is created with a non-empty domain (including an empty literal list, which was the case here): when the first field of the sequence is computed, base.automation's `_compute_field_value` is called. This calls `_filter_pre`, which (because `filter_pre_domain` is non-empty) calls `search` on the model. This would normally be innocuous as `search` will only flush the fields used in the search, however for `res.partner` the default `_order` is... `display_name`. Meaning we flush that computation, forcing the computation of `commercial_company_name`, but since `commercial_partner_id` is being computed we reuse its old value (or something), which is not re-recomputed after the `commercial_partner_id` computation ends. So rather than resolve a full search involving an order, filter the records in-place. OPW-2427264 closes odoo/odoo#67953 X-original-commit: e09a44db6a04cd37ad6f28b859f927970ac93fc5 Signed-off-by: Raphael Collet (rco) <rco@openerp.com> Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-10-02[FIX] *: fix all the typosMartin Trigaux
And other reported English mistakes in source string Courtesy of Transifex translators And remove leftover from gengo closes odoo/odoo#59002 Related: odoo/enterprise#13776 Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-02-08[FIX] base_automation: avoid access right issues filter domainsNicolas Seinlet
If some filter domains use M2O to models current user cannot access, using sudo() permit to filter even when user cannot access linked models. for the accuracy of the fix, add a unit test which reproduce the exact reported bug. closes odoo/odoo#44923 X-original-commit: 30e2153539643491fad889811a54a8e580fa9c58 Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-11-12[ADD] test_base_automation: Move tests and related modelsYannick Tivisse
Purpose ======= This module contains tests related to base automation. It makes no sense as they have no business value. Specification ============= Move all the tests to a separate module as it contains models used only to perform tests independently to functional aspects of other models.