diff --git a/partner_profiles/__manifest__.py b/partner_profiles/__manifest__.py
index 9006d74..ddd9831 100644
--- a/partner_profiles/__manifest__.py
+++ b/partner_profiles/__manifest__.py
@@ -3,7 +3,7 @@
{
"name": "partner_profiles",
- "version": "12.0.2.4.1",
+ "version": "12.0.2.5.0",
"author": "Elabore",
"website": "https://elabore.coop",
"maintainer": "Stéphan Sainléger",
diff --git a/partner_profiles/i18n/fr.po b/partner_profiles/i18n/fr.po
index 38878f8..1b55041 100644
--- a/partner_profiles/i18n/fr.po
+++ b/partner_profiles/i18n/fr.po
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-06-13 15:25+0000\n"
-"PO-Revision-Date: 2023-06-13 15:25+0000\n"
+"POT-Creation-Date: 2023-09-12 15:03+0000\n"
+"PO-Revision-Date: 2023-09-12 15:03+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -73,7 +73,7 @@ msgstr "Vous trouverez ici tou(te)s les adresses/contacts
msgid "You are about to create a Position Profile which\n"
" represents the role or the job of a person in a structure."
msgstr "Vous allez créer une fiche Fonction qui\n"
-" représente le rôle que tient une personne au sein d'une structure.""
+" représente le rôle que tient une personne au sein d'une structure.\""
#. module: partner_profiles
#: model_terms:ir.ui.view,arch_db:partner_profiles.partner_profiles_form_view
@@ -337,12 +337,12 @@ msgstr "État"
#. module: partner_profiles
#: model_terms:ir.ui.view,arch_db:partner_profiles.partner_profiles_form_view
msgid "Street 2..."
-msgstr "Rue 2 ..."
+msgstr "Rue 2..."
#. module: partner_profiles
#: model_terms:ir.ui.view,arch_db:partner_profiles.partner_profiles_form_view
msgid "Street..."
-msgstr "Rue.."
+msgstr "Rue..."
#. module: partner_profiles
#: model:ir.model.fields,field_description:partner_profiles.field_create_position_profile__structure_id
@@ -355,6 +355,16 @@ msgstr ""
msgid "Structure's positions"
msgstr "Fonctions occupées dans la structures"
+#. module: partner_profiles
+#: model_terms:ir.ui.view,arch_db:partner_profiles.partner_profiles_form_view
+msgid "Sync data"
+msgstr "Synchroniser"
+
+#. module: partner_profiles
+#: model:ir.actions.server,name:partner_profiles.sync_public_data_action_server
+msgid "Synchronize main and public data"
+msgstr "Synchroniser les données publiques"
+
#. module: partner_profiles
#: model:ir.model.fields,field_description:partner_profiles.field_res_partner__to_migrate
#: model:ir.model.fields,field_description:partner_profiles.field_res_users__to_migrate
diff --git a/partner_profiles/i18n/partner_profiles.pot b/partner_profiles/i18n/partner_profiles.pot
index fad6169..1d70b96 100644
--- a/partner_profiles/i18n/partner_profiles.pot
+++ b/partner_profiles/i18n/partner_profiles.pot
@@ -6,8 +6,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2023-06-13 15:24+0000\n"
-"PO-Revision-Date: 2023-06-13 15:24+0000\n"
+"POT-Creation-Date: 2023-09-12 15:02+0000\n"
+"PO-Revision-Date: 2023-09-12 15:02+0000\n"
"Last-Translator: <>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
@@ -340,6 +340,16 @@ msgstr ""
msgid "Structure's positions"
msgstr ""
+#. module: partner_profiles
+#: model_terms:ir.ui.view,arch_db:partner_profiles.partner_profiles_form_view
+msgid "Sync data"
+msgstr ""
+
+#. module: partner_profiles
+#: model:ir.actions.server,name:partner_profiles.sync_public_data_action_server
+msgid "Synchronize main and public data"
+msgstr ""
+
#. module: partner_profiles
#: model:ir.model.fields,field_description:partner_profiles.field_res_partner__to_migrate
#: model:ir.model.fields,field_description:partner_profiles.field_res_users__to_migrate
diff --git a/partner_profiles/models/res_partner.py b/partner_profiles/models/res_partner.py
index c3cc0d1..14cc25a 100644
--- a/partner_profiles/models/res_partner.py
+++ b/partner_profiles/models/res_partner.py
@@ -255,6 +255,22 @@ class res_partner(models.Model):
args.append(("is_public_profile", "=", False))
return super(res_partner, self).name_search(name, args, operator, limit)
+ @api.multi
+ def sync_admin_and_public_data(self):
+ for partner in self:
+ if partner.is_main_profile and partner.public_profile_id:
+ main_partner = partner
+ public_partner = partner.public_profile_id
+ elif partner.is_public_profile and partner.contact_id:
+ main_partner = partner.contact_id
+ public_partner = partner
+
+ public_fields = partner._get_public_profile_fields()
+ values = {}
+ for field_name in public_fields:
+ values[field_name] = main_partner._get_field_value(field_name)
+ public_partner.write(values)
+
##################################################################################
## Planned actions
##################################################################################
diff --git a/partner_profiles/views/res_partner_view.xml b/partner_profiles/views/res_partner_view.xml
index 5971e52..1ad46ef 100644
--- a/partner_profiles/views/res_partner_view.xml
+++ b/partner_profiles/views/res_partner_view.xml
@@ -42,6 +42,10 @@
+
@@ -196,6 +200,7 @@
options='{"no_open": True, "no_create": True}'
attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}" />
+
@@ -258,5 +263,13 @@
+
+
+ Synchronize main and public data
+
+
+ code
+ records.sync_admin_and_public_data()
+
\ No newline at end of file