diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2022-08-10 15:53:35 +0700 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2022-08-10 15:53:35 +0700 |
| commit | 06180f02fd39a917b46a6218c465c0fe94e37610 (patch) | |
| tree | 06349e99e7110646188124d0743b0795dd63392d /indoteknik_custom/models/purchase_pricelist.py | |
| parent | 2926fbf40b0aefc5507d35276711227f23f7367e (diff) | |
Membuat view dan model purchase.pricelist, referensi harga ke purchase.pricelist untuk order_line di purchase.order
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 |
