Steps to reproduce:
- Install `l10n_ar_website_sale` module
- Go to shop (Argentinian website) and add a product to cart
- Open cart and click on checkout
- Click on Customize and disable `Show b2b fields` feature
Issue:
Fields are no more displayed.
Cause:
Since the b2b fields template (`address_b2b`) is customizable (meaning
it can be enabled/disabled), it is possible for all countries to
display/hide the b2b fields, but for some countries (for example
Argentina) it should not; the b2b fields should always be displayed.
Solution:
Add a method (`_display_partner_b2b_fields`) on website model to know
if b2b fields should be displayed: return True if `address_b2b` view
is active on current website or if the company (based on the country)
must display them.
Move content (b2b fields; vat and company name fields) of view
`address_b2b` in `address` main view and let the `address_b2b` only be
used as switch to display or hide the b2b fields.
Add a condition in `address` view to display b2b fields only if the
method `_display_partner_b2b_fields` returns `True`
opw-2941199
closesodoo/odoo#104505
X-original-commit: 1b5c85722db00a44ed8c6cb0c2bdba8905dc5292
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>