diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2025-02-25 13:51:45 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2025-02-25 13:51:45 +0700 |
| commit | a24d7b2a21ff24e31eef77e2032a861b7eb13e31 (patch) | |
| tree | a3f69b77ef67739275f99fa774fab6d002742a64 /indoteknik_custom/models/purchase_order_sales_match.py | |
| parent | c9f221da247bb35c0c1005e5d8888d7ab1a4bf37 (diff) | |
fix bug
Diffstat (limited to 'indoteknik_custom/models/purchase_order_sales_match.py')
| -rw-r--r-- | indoteknik_custom/models/purchase_order_sales_match.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order_sales_match.py b/indoteknik_custom/models/purchase_order_sales_match.py index 4ebe959b..ed013dd5 100644 --- a/indoteknik_custom/models/purchase_order_sales_match.py +++ b/indoteknik_custom/models/purchase_order_sales_match.py @@ -26,6 +26,11 @@ class PurchaseOrderSalesMatch(models.Model): 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') + purchase_line_id = fields.Many2one('purchase.order.line', string='Purchase Line', compute='_compute_purchase_line_id') + + def _compute_purchase_line_id(self): + for line in self: + line.purchase_line_id = self.env['purchase.order.line'].search([('order_id', '=', line.purchase_order_id.id), ('product_id', '=', line.product_id.id)]) def _compute_purchase_price_po(self): for line in self: |
