Skip to content
Extraits de code Groupes Projets
Valider e2ebdc6a rédigé par Benjamin's avatar Benjamin
Parcourir les fichiers

fix erreur onchange phone

parent 5c10d7c1
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -429,13 +429,13 @@ class ScopPartner(models.Model): ...@@ -429,13 +429,13 @@ class ScopPartner(models.Model):
@api.onchange('mobile') @api.onchange('mobile')
def onchange_mobile(self): def onchange_mobile(self):
if len(self.mobile) > 0 and len(self.mobile) < 10: if self.phone and len(self.mobile) > 0 and len(self.mobile) < 10:
raise ValidationError( raise ValidationError(
"Le numéro de téléphone doit contenir au moins 10 caractères") "Le numéro de téléphone doit contenir au moins 10 caractères")
@api.onchange('phone') @api.onchange('phone')
def onchange_phone(self): def onchange_phone(self):
if len(self.phone) > 0 and len(self.phone) < 10: if self.phone and len(self.phone) > 0 and len(self.phone) < 10:
raise ValidationError( raise ValidationError(
"Le numéro de téléphone doit contenir au moins 10 caractères") "Le numéro de téléphone doit contenir au moins 10 caractères")
......
...@@ -37,6 +37,9 @@ ...@@ -37,6 +37,9 @@
<field name="model">res.partner</field> <field name="model">res.partner</field>
<field name="inherit_id" ref="base.view_partner_form"/> <field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<field name="parent_id" position="before">
<label for="parent_id" string="Société"/>
</field>
<xpath expr="//div[hasclass('oe_title')]" position="attributes"> <xpath expr="//div[hasclass('oe_title')]" position="attributes">
<attribute name="class">oe_title oe_title_cgscop</attribute> <attribute name="class">oe_title oe_title_cgscop</attribute>
</xpath> </xpath>
......
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