From 7fe21235d9a83db46218c29ba3d8df0318cb08fc Mon Sep 17 00:00:00 2001 From: Samir Ladoui Date: Wed, 16 Apr 2025 07:49:04 +0100 Subject: [PATCH] [FIX] purchase_requisition_custom --- .../models/purchase_order.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/odex25_purchase/purchase_requisition_custom/models/purchase_order.py b/odex25_purchase/purchase_requisition_custom/models/purchase_order.py index 4d2a2ba61..e8dfffa5c 100644 --- a/odex25_purchase/purchase_requisition_custom/models/purchase_order.py +++ b/odex25_purchase/purchase_requisition_custom/models/purchase_order.py @@ -525,19 +525,19 @@ class PurchaseOrderCustom(models.Model): line.choosen = True self._amount_all() - @api.constrains('requisition_id', 'partner_id') - def PreventSameVendor(self): - """ - Constrain to prevent the same vendor in the order for the same requisition - """ - orders = self.env['purchase.order'].search([ - ('id', '!=', self.id), - ('requisition_id', '=', self.requisition_id.id), - ('requisition_id', '!=', False), - ('partner_id', '=', self.partner_id.id) - ]) - if len(orders) != 0: - raise ValidationError(_("This Vendor have order before")) + # @api.constrains('requisition_id', 'partner_id') + # def PreventSameVendor(self): + # """ + # Constrain to prevent the same vendor in the order for the same requisition + # """ + # orders = self.env['purchase.order'].search([ + # ('id', '!=', self.id), + # ('requisition_id', '=', self.requisition_id.id), + # ('requisition_id', '!=', False), + # ('partner_id', '=', self.partner_id.id) + # ]) + # if len(orders) != 0: + # raise ValidationError(_("This Vendor have order before")) # test