diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-02-25 13:41:56 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-02-25 13:41:56 +0700 |
| commit | c9f221da247bb35c0c1005e5d8888d7ab1a4bf37 (patch) | |
| tree | 2b071deda75de6efb9b6c4082dc7ea424207a32a /indoteknik_custom/models/purchase_order_sales_match.py | |
| parent | 093bd33ba36ba123a53853e7407e534f9f23734b (diff) | |
| parent | 8539e68a94c09fe9496f7d93fda8961fcd254211 (diff) | |
Merge branch 'odoo-production' into CR/renca-voucher
Diffstat (limited to 'indoteknik_custom/models/purchase_order_sales_match.py')
| -rw-r--r-- | indoteknik_custom/models/purchase_order_sales_match.py | 7 |
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: |
