diff options
Diffstat (limited to 'indoteknik_custom/models/purchase_pricelist.py')
| -rw-r--r-- | indoteknik_custom/models/purchase_pricelist.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_pricelist.py b/indoteknik_custom/models/purchase_pricelist.py new file mode 100644 index 00000000..25e551ae --- /dev/null +++ b/indoteknik_custom/models/purchase_pricelist.py @@ -0,0 +1,14 @@ +from odoo import models, fields, api + + +class PurchasePricelist(models.Model): + _name = 'purchase.pricelist' + + name = fields.Char(string='Name', compute="_compute_name") + product_id = fields.Many2one('product.product', string="Product", required=True) + vendor_id = fields.Many2one('res.partner', string="Vendor", required=True) + product_price = fields.Float(string='Price', required=True) + + @api.depends('product_id', 'vendor_id') + def _compute_name(self): + self.name = self.vendor_id.name + ', ' + self.product_id.name |
