59a78b344a045f8876206bfdfe67176611640d16
The same override of `_get_view` was done in `res.partner` and `crm.lead` in order to call `_view_get_address`, to change the address format of the partner and lead form. The definition of `_view_get_address` was already shared between these two models through the `format.address.mixin` mixin. So, why not share the override of `_get_view` also in this mixin, so only one override needs to be written, instead of two. In addition to merge the code of the `_get_view` override in `format.address.mixin`, also set the `_get_view_cache_key`, so the partner and lead form are correctly cached by company, in case multiple companies in a same db use different address views. Before this revision, this wasn't the case for `crm.lead`, which therefore leaded to a bug when two companies where using different address view, and one company accessed the lead form before the other, therefore caching its own view version in the cache, re-used later by the second company when fetching its own lead form. This revision takes the opportunity to add a unit test for crm.lead, to assert the expected form according to the company address. There was already a test for res.partner, but not for crm.lead. To avoid copy/pasting the unit for both models, a common test class is created, re-used to test both res.partner and crm.lead. closes odoo/odoo#103438 X-original-commit: 7e4a8b77024af663c5555c6d56557e2c6136b24b Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%