[FIX] l10n_{cz,sk}: avoid duplicate company registry field

Current state:

- Company ID field in the Contacts form view is introduced by the base module and it is put into the Purchase tab.
- l10n_cz module adds an invisibility attribute to that field which hides it if the current company is not based in CZ. It also adds another instance of the field into the main tab but also adds the same invisibility attribute for the field.
- If l10n_sk module is installed next (e.g. in a multicompany setup) it adds another instance of the field into the main tab but changes the visibility attribute of all the instances suit SK-based companies. However this means the field becomes hidden for CZ-based companies (current company). Plus the field is doubled if the current company is a SK-based one.
- A similar problem happens if the l10n_sk is installed first and l10n_cz comes after it.

Fix:
- Remove the invisible attribute so that the Company ID field on the main tab and on Sales and Purchase tab remains untouched and visible whatever the current company's country is.

closes odoo/odoo#158605

Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
Odoo's Mergebot
2024-03-21 23:03:07 +00:00
committed by Odoo Online
2 changed files with 1 additions and 7 deletions
@@ -5,9 +5,6 @@
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.view_partner_property_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='company_registry']" position="replace">
<field name="company_registry" invisible="'CZ' not in fiscal_country_codes"/>
</xpath>
<xpath expr="//field[@name='vat']" position="before">
<field name="company_registry" invisible="'CZ' not in fiscal_country_codes"/>
</xpath>
+1 -4
View File
@@ -5,10 +5,7 @@
<field name="model">res.partner</field>
<field name="inherit_id" ref="account.view_partner_property_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='company_registry']" position="replace">
<field name="company_registry" invisible="'SK' not in fiscal_country_codes"/>
</xpath>
<xpath expr="//field[@name='vat']" position="after">
<xpath expr="//field[@name='vat']" position="before">
<field name="company_registry" invisible="'SK' not in fiscal_country_codes"/>
</xpath>
</field>