summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order_line.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2023-08-09 06:48:17 +0000
committerIT Fixcomart <it@fixcomart.co.id>2023-08-09 06:48:17 +0000
commit072694ec9464142ff1029ea4b070496e513c03c6 (patch)
treeaa04c3b421ac936a65a7706e9372d6d901f932db /indoteknik_custom/models/purchase_order_line.py
parent4aa5108543075227378b856ce31f478bd5a3b3db (diff)
parent3ef9d136bd238464de7ff0a224b1a68a9b7bb1f3 (diff)
Merged in email-po (pull request #91)
Email po
Diffstat (limited to 'indoteknik_custom/models/purchase_order_line.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order_line.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py
index f255095f..39aeba0f 100755
--- a/indoteknik_custom/models/purchase_order_line.py
+++ b/indoteknik_custom/models/purchase_order_line.py
@@ -28,6 +28,21 @@ class PurchaseOrderLine(models.Model):
qty_outgoing = fields.Float('Qty Outgoing', compute='compute_qty_stock')
qty_available_store = fields.Float(string='Available')
suggest = fields.Char(string='Suggest')
+ price_vendor = fields.Float(string='Price Vendor', compute='compute_price_vendor')
+
+ def compute_price_vendor(self):
+ for line in self:
+ purchase_pricelist = self.env['purchase.pricelist'].search([
+ ('product_id', '=', line.product_id.id),
+ ('vendor_id', '=', line.order_id.partner_id.id)
+ ], limit=1)
+
+ if purchase_pricelist:
+ price_vendor = format(purchase_pricelist.product_price, ".2f")
+ price_vendor = float(price_vendor)
+ line.price_vendor = price_vendor
+ else:
+ line.price_vendor = 0
def compute_qty_stock(self):
for line in self: