summaryrefslogtreecommitdiff
path: root/fixco_custom/models/purchase_pricelist.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-06-04 16:57:56 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-06-04 16:57:56 +0700
commitef860cf6815dceb0a806a08b2118390830ccdae0 (patch)
treea2d647fdae4a60db4486080b9c3a284fa7d644c8 /fixco_custom/models/purchase_pricelist.py
parent91607253601526603d74399f5603ed9ffb3a7b86 (diff)
purchase pricelist and schema invoice
Diffstat (limited to 'fixco_custom/models/purchase_pricelist.py')
-rw-r--r--fixco_custom/models/purchase_pricelist.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/fixco_custom/models/purchase_pricelist.py b/fixco_custom/models/purchase_pricelist.py
new file mode 100644
index 0000000..2d0a77c
--- /dev/null
+++ b/fixco_custom/models/purchase_pricelist.py
@@ -0,0 +1,18 @@
+from odoo import fields, models, api, _
+from odoo.exceptions import AccessError, UserError, ValidationError
+from datetime import datetime, timedelta
+from pytz import timezone
+
+class PurchasePricelist(models.Model):
+ _name = 'purchase.pricelist'
+ _rec_name = 'product_id'
+ _inherit = ['mail.thread', 'mail.activity.mixin']
+
+ 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)
+ 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 \ No newline at end of file