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

Merge branch 'label_haie' into '14.0'

[UPD] Added label_haie fields to res.partner

See merge request !4
parents 59717f65 55588a5e
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):
string="Champs à copier",
compute="_compute_copy_to_clipboard",
)
label_haie = fields.Char()
show_label_haie = fields.Boolean(compute="_compute_show_label_haie", store=True)
# ------------------------------------------------------
# SQL Constraints
# ------------------------------------------------------
......@@ -156,6 +158,17 @@ class ResPartner(models.Model):
res = res.replace("\n\n", "\n")
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
def _get_default_address_format_simple(self):
return "%(street)s\n%(street2)s\n%(street3)s\n%(zip)s %(city)s"
......
......@@ -210,9 +210,9 @@
<div
t-attf-class="badge badge-pill o_tag_color_#{record.mandate_id_color.raw_value}"
>
<span class="o_badge_text"><t
t-esc="record.mandate_id.value"
/></span>
<span class="o_badge_text">
<t t-esc="record.mandate_id.value" />
</span>
</div>
</div>
</div>
......@@ -260,6 +260,11 @@
<field name="legal_representative" optional="hide" />
<field name="project_ids" widget="many2many_tags" 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),('is_company','=',False)]}"
/>
</xpath>
<field name="user_id" position="attributes">
<attribute name="invisible">1</attribute>
......@@ -384,22 +389,28 @@
<span class="o_form_label o_td_label" name="address_name">
<b
attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'contact')]}"
>Adresse de la Société</b>
>Adresse de la Société
</b>
<b
attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'invoice')]}"
>Adresse de facturation</b>
>Adresse de facturation
</b>
<b
attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'delivery')]}"
>Adresse de livraison</b>
>Adresse de livraison
</b>
<b
attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'other')]}"
>Autre adresse</b>
>Autre adresse
</b>
<b
attrs="{'invisible': ['|', ('parent_id', '=', False), ('type', '!=', 'private')]}"
>Adresse Privée</b>
>Adresse Privée
</b>
<b
attrs="{'invisible': ['&amp;', ('parent_id', '!=', False), ('type', '!=', False)]}"
>Adresse</b>
>Adresse
</b>
</span>
</xpath>
<xpath expr="//field[@name='category_id']" position="attributes">
......@@ -451,7 +462,18 @@
<xpath expr="//field[@name='child_ids']" position="attributes">
<attribute
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
expr="//field[@name='child_ids']/kanban/field[@name='display_name']"
......@@ -478,16 +500,19 @@
<div
t-attf-class="badge badge-pill o_tag_color_#{record.mandate_id_color.raw_value}"
>
<span class="o_badge_text"><t
t-esc="record.mandate_id.value"
/></span>
<span class="o_badge_text">
<t t-esc="record.mandate_id.value" />
</span>
</div>
</div>
</t>
<t t-if="record.is_legal_representative.raw_value">
<p><span
<p>
<span
class="badge badge-pill badge-danger"
>Représentant Légal</span></p>
>Représentant Légal
</span>
</p>
</t>
</xpath>
<xpath
......@@ -553,6 +578,14 @@
position="before"
>
<page name="projects" string="Projets">
<group>
<field name="show_label_haie" invisible="1" />
<field
name="label_haie"
attrs="{'invisible': ['|',('show_label_haie','=', False),('is_company','=',False)]}"
/>
</group>
<field name="project_ids">
<tree>
<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