Skip to content
Extraits de code Groupes Projets
Valider cc13b5ac rédigé par Thibaud - Le Filament's avatar Thibaud - Le Filament
Parcourir les fichiers

[UPD] Added label_haie fields to res.partner

parent 59717f65
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!4[UPD] Added label_haie fields to res.partner
...@@ -114,6 +114,8 @@ class ResPartner(models.Model): ...@@ -114,6 +114,8 @@ class ResPartner(models.Model):
string="Champs à copier", string="Champs à copier",
compute="_compute_copy_to_clipboard", compute="_compute_copy_to_clipboard",
) )
label_haie = fields.Char()
show_label_haie = fields.Boolean(compute="_compute_show_label_haie", store=True)
# ------------------------------------------------------ # ------------------------------------------------------
# SQL Constraints # SQL Constraints
# ------------------------------------------------------ # ------------------------------------------------------
...@@ -156,6 +158,17 @@ class ResPartner(models.Model): ...@@ -156,6 +158,17 @@ class ResPartner(models.Model):
res = res.replace("\n\n", "\n") res = res.replace("\n\n", "\n")
record.fields_to_copy_to_clipboard = res.lstrip() record.fields_to_copy_to_clipboard = res.lstrip()
@api.depends("project_ids")
def _compute_show_label_haie(self):
label_haie_project = self.env["afac.project"].search(
[("name", "=", "Label Haie")]
)
for partner in self:
if label_haie_project in partner.project_ids.mapped("project_id"):
partner.show_label_haie = True
else:
partner.show_label_haie = False
@api.model @api.model
def _get_default_address_format_simple(self): def _get_default_address_format_simple(self):
return "%(street)s\n%(street2)s\n%(street3)s\n%(zip)s %(city)s" return "%(street)s\n%(street2)s\n%(street3)s\n%(zip)s %(city)s"
......
...@@ -210,9 +210,9 @@ ...@@ -210,9 +210,9 @@
<div <div
t-attf-class="badge badge-pill o_tag_color_#{record.mandate_id_color.raw_value}" t-attf-class="badge badge-pill o_tag_color_#{record.mandate_id_color.raw_value}"
> >
<span class="o_badge_text"><t <span class="o_badge_text">
t-esc="record.mandate_id.value" <t t-esc="record.mandate_id.value" />
/></span> </span>
</div> </div>
</div> </div>
</div> </div>
...@@ -260,6 +260,11 @@ ...@@ -260,6 +260,11 @@
<field name="legal_representative" optional="hide" /> <field name="legal_representative" optional="hide" />
<field name="project_ids" widget="many2many_tags" optional="hide" /> <field name="project_ids" widget="many2many_tags" optional="hide" />
<field name="short_name" optional="hide" /> <field name="short_name" optional="hide" />
<field name="show_label_haie" invisible="True" />
<field
name="label_haie"
attrs="{'invisible': [('show_label_haie','=', False)]}"
/>
</xpath> </xpath>
<field name="user_id" position="attributes"> <field name="user_id" position="attributes">
<attribute name="invisible">1</attribute> <attribute name="invisible">1</attribute>
...@@ -384,22 +389,28 @@ ...@@ -384,22 +389,28 @@
<span class="o_form_label o_td_label" name="address_name"> <span class="o_form_label o_td_label" name="address_name">
<b <b
attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'contact')]}" attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'contact')]}"
>Adresse de la Société</b> >Adresse de la Société
</b>
<b <b
attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'invoice')]}" attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'invoice')]}"
>Adresse de facturation</b> >Adresse de facturation
</b>
<b <b
attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'delivery')]}" attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'delivery')]}"
>Adresse de livraison</b> >Adresse de livraison
</b>
<b <b
attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'other')]}" attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'other')]}"
>Autre adresse</b> >Autre adresse
</b>
<b <b
attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'private')]}" attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'private')]}"
>Adresse Privée</b> >Adresse Privée
</b>
<b <b
attrs="{'invisible': ['&amp;', ('parent_id', '!=', False), ('type', '!=', False)]}" attrs="{'invisible': ['&amp;', ('parent_id', '!=', False), ('type', '!=', False)]}"
>Adresse</b> >Adresse
</b>
</span> </span>
</xpath> </xpath>
<xpath expr="//field[@name='category_id']" position="attributes"> <xpath expr="//field[@name='category_id']" position="attributes">
...@@ -451,7 +462,18 @@ ...@@ -451,7 +462,18 @@
<xpath expr="//field[@name='child_ids']" position="attributes"> <xpath expr="//field[@name='child_ids']" position="attributes">
<attribute <attribute
name="context" name="context"
>{'default_parent_id': active_id, 'default_street': street, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_lang': lang, 'default_user_id': user_id, 'default_type': 'contact', 'default_thematic_id': thematic_id, 'default_org_type_id': org_type_id, 'default_college_id': college_id, 'default_region_id': region_id, 'default_website': website, 'default_short_name': short_name, 'default_legal_status_id': legal_status_id, 'default_legal_status_detail_id': legal_status_detail_id}</attribute> >{'default_parent_id': active_id, 'default_street': street,
'default_street2': street2, 'default_city': city,
'default_state_id': state_id, 'default_zip': zip,
'default_country_id': country_id, 'default_lang': lang,
'default_user_id': user_id, 'default_type': 'contact',
'default_thematic_id': thematic_id, 'default_org_type_id':
org_type_id, 'default_college_id': college_id,
'default_region_id': region_id, 'default_website': website,
'default_short_name': short_name, 'default_legal_status_id':
legal_status_id, 'default_legal_status_detail_id':
legal_status_detail_id}
</attribute>
</xpath> </xpath>
<xpath <xpath
expr="//field[@name='child_ids']/kanban/field[@name='display_name']" expr="//field[@name='child_ids']/kanban/field[@name='display_name']"
...@@ -478,16 +500,19 @@ ...@@ -478,16 +500,19 @@
<div <div
t-attf-class="badge badge-pill o_tag_color_#{record.mandate_id_color.raw_value}" t-attf-class="badge badge-pill o_tag_color_#{record.mandate_id_color.raw_value}"
> >
<span class="o_badge_text"><t <span class="o_badge_text">
t-esc="record.mandate_id.value" <t t-esc="record.mandate_id.value" />
/></span> </span>
</div> </div>
</div> </div>
</t> </t>
<t t-if="record.is_legal_representative.raw_value"> <t t-if="record.is_legal_representative.raw_value">
<p><span <p>
<span
class="badge badge-pill badge-danger" class="badge badge-pill badge-danger"
>Représentant Légal</span></p> >Représentant Légal
</span>
</p>
</t> </t>
</xpath> </xpath>
<xpath <xpath
...@@ -553,6 +578,14 @@ ...@@ -553,6 +578,14 @@
position="before" position="before"
> >
<page name="projects" string="Projets"> <page name="projects" string="Projets">
<group>
<field name="show_label_haie" invisible="1" />
<field
name="label_haie"
attrs="{'invisible': [('show_label_haie','=', False)]}"
/>
</group>
<field name="project_ids"> <field name="project_ids">
<tree> <tree>
<field <field
......
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