Skip to content
Extraits de code Groupes Projets
Valider 35d4ae77 rédigé par Juliana's avatar Juliana
Parcourir les fichiers

[UPD]Update with back mail 16/03

parent 7dd23c8a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -106,7 +106,8 @@ class ResPartner(models.Model):
contact_address_simple = fields.Char(
compute="_compute_contact_address_simple", string="Adresse simplifiée")
fields_to_copy_to_clipboard = fields.Char("Champs à copier", compute="_compute_copy_to_clipboard", )
fields_to_copy_to_clipboard = fields.Char(
string="Champs à copier", compute="_compute_copy_to_clipboard", )
# ------------------------------------------------------
# SQL Constraints
# ------------------------------------------------------
......@@ -120,14 +121,14 @@ class ResPartner(models.Model):
# ------------------------------------------------------
def _compute_copy_to_clipboard(self):
for record in self:
res = (record.lastname or "") + " " + (record.firstname or "") + "\n" + (record.street or "") + "\n" + (record.street2 or "") + "\n" + (record.street3 or "") + "\n" + (record.zip or "") + " " + (record.city or "") + "\n" + (record.parent_id.name or "") + "\n" + (record.mobile or "") + "\n" + (record.email or "")
res = (record.firstname or "") + "\n" + (record.lastname or "") + " " + (record.street or "") + "\n" + (record.street2 or "") + "\n" + (record.street3 or "") + "\n" + (record.zip or "") + " " + (record.city or "") + "\n" + (record.parent_id.name or "") + "\n" + (record.mobile or "") + "\n" + (record.email or "")
while "\n\n" in res:
res = res.replace("\n\n", "\n")
record.fields_to_copy_to_clipboard = res.lstrip()
@api.model
def _get_default_address_format_simple(self):
return "%(street)s\n%(street2)s\n%(street3)s\n%(city)s %(zip)s"
return "%(street)s\n%(street2)s\n%(street3)s\n%(zip)s %(city)s"
@api.model
def _get_address_format_simple(self):
......
......@@ -286,7 +286,7 @@
/>
</xpath>
<xpath expr="//field[@name='user_ids']" position="before">
<field name="phone3" widget="phone" />
<field name="phone3" widget="phone" attrs="{'invisible': [('parent_id', '=', False)]}"/>
</xpath>
<xpath expr="//field[@name='website']" position="before">
<field name="email2" widget="email" />
......@@ -474,7 +474,7 @@
expr="//field[@name='child_ids']/form/sheet/group/group/field[@name='mobile']"
position="after"
>
<field name="phone3" widget="phone" />
<field name="phone3" widget="phone" attrs="{'invisible': [('parent_id', '=', False)]}"/>
</xpath>
<xpath
expr="//field[@name='child_ids']/form/sheet/group/group/field[@name='function']"
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter