Se rendre au contenu
Menu
Cette question a été signalée
2 Réponses
1441 Vues

Hi,

in my res.partner there are 2 boolean named customer and supplier if i click the Add button of contact before the customer and supplier button filled, i want to show the popup or warning message regarding the boolean in the parent ,

already i have 

@api.model
def create(self, vals):
if not (vals.get('customer')==True or vals.get('supplier')==True or self.env.context.get('flag_partner')==1):
raise ValidationError(_("You have to choose a CheckBox Either Customer/Supplier"))
return super(ResPartner, self).create(vals)

warning message in create function but how can i get the warning when i click on the ADD button

thanks in advance


Avatar
Ignorer
Meilleure réponse

Hello Neethu,

You can show the warning message by using default_get method.

I hope this would be helpful.

Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari

Avatar
Ignorer
Meilleure réponse

HI,

Can you try with the onchange function of the one2many field: child_ids . Write an onchange function for the one2many fields and based on the condition try returning warning from it.


Thanks & Regards

Walnut Software Solutions

Avatar
Ignorer
Auteur

hi,
yes, i tried with onchange function but when we click the add button and change the fields in the form then it will work