[IMP] partner_profiles: prevent company type edit in several cases

Prevents the modification of the company type of res.partner:
- if partner is a public or a position profile
- if the partner has position profiles attached

Also synchronize the company type between main and public profiles.
This commit is contained in:
Stéphan Sainléger
2023-05-19 14:31:39 +02:00
committed by Stéphan Sainléger
parent c95d20d7a1
commit 379b598754
2 changed files with 18 additions and 0 deletions

View File

@@ -95,6 +95,10 @@
<attribute name="attrs">{'invisible': ['|', ('is_public_profile','=', True),
('is_position_profile','=', True)]}</attribute>
</xpath>
<xpath expr="//field[@name='company_type']" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('is_public_profile','=', True),
('is_position_profile','=', True)]}</attribute>
</xpath>
<xpath expr="//field[@name='image']" position="attributes">
<attribute name="attrs">{'invisible': ['|', ('is_public_profile','=', True),
('is_position_profile','=', True)]}</attribute>