From 06180f02fd39a917b46a6218c465c0fe94e37610 Mon Sep 17 00:00:00 2001 From: IT Fixcomart Date: Wed, 10 Aug 2022 15:53:35 +0700 Subject: Membuat view dan model purchase.pricelist, referensi harga ke purchase.pricelist untuk order_line di purchase.order --- indoteknik_custom/models/purchase_pricelist.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 indoteknik_custom/models/purchase_pricelist.py (limited to 'indoteknik_custom/models/purchase_pricelist.py') 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 -- cgit v1.2.3