summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order_sales_match.py
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-02-25 11:47:47 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-02-25 11:47:47 +0700
commitd5d7948d38ca1893317c6eb379fbdbacdb14a996 (patch)
treef3d166149a28a0c829199c85ae3329651950585a /indoteknik_custom/models/purchase_order_sales_match.py
parent63c712cd38666723a112899d49af3ee82af9bf89 (diff)
parent6eecc5ecd377e6e7b69519294259b8e66cd8e564 (diff)
Merge branch 'odoo-production' into CR/number-adjusment
Diffstat (limited to 'indoteknik_custom/models/purchase_order_sales_match.py')
-rw-r--r--indoteknik_custom/models/purchase_order_sales_match.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order_sales_match.py b/indoteknik_custom/models/purchase_order_sales_match.py
index d1d929d3..4ebe959b 100644
--- a/indoteknik_custom/models/purchase_order_sales_match.py
+++ b/indoteknik_custom/models/purchase_order_sales_match.py
@@ -24,6 +24,13 @@ class PurchaseOrderSalesMatch(models.Model):
margin_item = fields.Float(string='Margin')
delivery_amt = fields.Float(string='Delivery Amount', compute='_compute_delivery_amt')
margin_deduct = fields.Float(string='After Deduct', compute='_compute_delivery_amt')
+ purchase_price_so = fields.Float(string='Purchase Price Sale Order', related='sale_line_id.purchase_price')
+ purchase_price_po = fields.Float('Purchase Price PO', compute='_compute_purchase_price_po')
+
+ def _compute_purchase_price_po(self):
+ for line in self:
+ purchase_price = self.env['purchase.order.line'].search([('order_id', '=', line.purchase_order_id.id), ('product_id', '=', line.product_id.id)])
+ line.purchase_price_po = purchase_price.price_unit
def _compute_delivery_amt(self):
for line in self: