diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-07-12 10:40:06 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-07-12 10:40:06 +0700 |
| commit | ad1f21b27dff6eca4eb90d2a4496cd9ff80701c4 (patch) | |
| tree | d3335e6a6d1be85a903ef5699b07cc303619c954 /fixco_custom/models/purchase_pricelist.py | |
| parent | f12beff2f1e4da1244e7a8e014e73e5e5023aa9d (diff) | |
purchasing job, requisition, reordering v2
Diffstat (limited to 'fixco_custom/models/purchase_pricelist.py')
| -rw-r--r-- | fixco_custom/models/purchase_pricelist.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fixco_custom/models/purchase_pricelist.py b/fixco_custom/models/purchase_pricelist.py index 2d0a77c..6f5bd21 100644 --- a/fixco_custom/models/purchase_pricelist.py +++ b/fixco_custom/models/purchase_pricelist.py @@ -13,6 +13,10 @@ class PurchasePricelist(models.Model): vendor_id = fields.Many2one('res.partner', string="Vendor", required=True) price = fields.Float(string='Price', required=True) + _sql_constraints = [ + ('product_unique', 'unique (product_id)', 'This product already has a purchase pricelist!'), + ] + @api.depends('product_id', 'vendor_id') def _compute_name(self): self.name = self.vendor_id.name + ', ' + self.product_id.name
\ No newline at end of file |
