hello everybody , I want to add a a constraint but I don't have the idea to do it . here is my code
so l have tow type of products(article) TTC and UA so how I can change the order-line to stop the user entering tow type of product in the same quotation , we should not have tow different type of product TTC and UA in tha same quotation
thank you in advance .
class Article(models.Model):
_inherit = 'product.template'
_name = 'product.template'
Reference_article = fields.Char('Internal Reference', index=True, required=True)
purchase_ok = fields.Boolean(default=False)
quantite = fields.Integer()
prix_tarif = fields.Float(digits=(8, 2), required=True)
prix_net = fields.Float(digits=(8, 2), required=True)
typea = fields.Selection([('t', 'TTC'), ('u', 'UA')], default='t', required=True)
emplacment_ev = fields.Many2one('euler.emplacement', string="Emplacement")class Sales(models.Model):
_inherit = 'sale.order'
_name = 'sale.order'