Daily updates from Odoo
Thursday, December 19, 2019
3 changes
Enhancements to existing features
Point of Sale customer lists now show only contacts that have previously acted as customers, reducing clutter from unrelated partners. Each paid POS order also increases the customer ranking for the buyer, helping keep customer records accurate over time.
Original PR description
Following the removing of the vendor and customer field, when we wanted to display customer in the pos, we saw all. Now, we only see partner with a customer rank higher than 0. We also increase the customer rank each time a pos order is paid. task-id: 2092483 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Default values are now selected based on the company being set on a new record, rather than always using the current user's company. This improves consistency in multi-company setups and helps avoid records being created with values from the wrong company.
Original PR description
**Description of the issue/feature this PR addresses:** Suppose a model that have "A" and "company_id" fields. In multi-company, the user in company C creates a record of this model with company_id =…
**Description of the issue/feature this PR addresses:** Suppose a model that have "A" and "company_id" fields. In multi-company, the user in company C creates a record of this model with company_id = C2. In the creation of this record, the `default_get` method is executed. If in context doesn't exist a "`default_A`", then A field will have the value obtained in `get_model_defaults` method. But this method will return the default in company C instead of the default in company C2. So, it's not consistent to have a record in company C2 and one of its attributes (subfields) in company C. **Current behavior before PR:** The `get_model_defaults` method always considers the company of the user for finding default values. **Desired behavior after PR is merged:** The `get_model_defaults` method first considers the `default_company_id` context for finding default values, and if doesn't exist this context then finds with the company of the user. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Code cleanup and technical improvements
The website editor now handles hidden page elements more consistently by showing or hiding their editing options instead of triggering actions directly on invisible content. This makes editing snippets such as countdowns, popups, and mailing blocks clearer and reduces confusing behavior when content is hidden or saved.
Original PR description
* website, website_mass_mailing
Instead of triggering an event on the invisible element when its related
button in the left panel is clicked, the invisible element's options are
now toggled (shown if were hidden and hidden if were shown). To do that
the new 'onTargetShow' and 'onTargetHide' methods are called, and the
appropriate action can be done there.
Those two new methods are also automatically called in other cases:
- When dropped in the page, after onBuild, 'onTargetShow' is called
for any snippet.
- Before cleanForSave: 'onTargetHide' is called for snippets with the
'o_snippet_invisible' and 'onTargetShow' is called for the others.
In case the element visibility should be toggled another way (like the
close button of a modal), the option can trigger_up an event named
'snippet_option_visibility_update' with a 'show' parameter so that the
the UI is updated accordingly (and so that the options are hidden if
necessary).