[IMP] partner_profiles: add sync function for admin and public data

This commit is contained in:
Stéphan Sainléger
2023-09-12 17:00:00 +02:00
committed by Stéphan Sainléger
parent edfb018ed3
commit 4e18b41b70
5 changed files with 57 additions and 8 deletions

View File

@@ -42,6 +42,10 @@
<button type="object" name="create_public_profile"
string="Create Public Profile"
attrs="{'invisible': [('public_profile_id','!=',False)]}" />
<button string="Sync data"
name="sync_admin_and_public_data" type="object"
icon="fa-refresh"
attrs="{'invisible': [('public_profile_id','=',False)]}" />
</div>
</group>
</group>
@@ -196,6 +200,7 @@
options='{"no_open": True, "no_create": True}'
attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}" />
</div>
</group>
<group>
<field name="phone" widget="phone" />
@@ -258,5 +263,13 @@
</xpath>
</field>
</record>
<record id="sync_public_data_action_server" model="ir.actions.server">
<field name="name">Synchronize main and public data</field>
<field name="model_id" ref="model_res_partner" />
<field name="groups_id" eval="[(4,ref('base.group_no_one'))]" />
<field name="state">code</field>
<field name="code">records.sync_admin_and_public_data() </field>
</record>
</data>
</odoo>