summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2024-06-12 09:18:20 +0700
committerstephanchrst <stephanchrst@gmail.com>2024-06-12 09:18:20 +0700
commit590decb22298c53e13265c49be568731f8275f9f (patch)
tree73e0789042ffa8066f94afc91469ebe18f4996e0 /indoteknik_custom/models
parent2c7c774119f47025d1577cfa6b8c88e3cc5a0607 (diff)
add matches so in purchase order view
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 3a959391..810d6b2f 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -57,6 +57,15 @@ class PurchaseOrder(models.Model):
from_apo = fields.Boolean(string='From APO', tracking=3)
approval_edit_line = fields.Boolean(string='Approval Edit Line', tracking=3)
sale_order = fields.Char(string='Sale Order')
+ matches_so = fields.Many2many('sale.order', string='Matches SO', compute='_compute_matches_so')
+
+ def _compute_matches_so(self):
+ for po in self:
+ matches = []
+ for match in po.order_sales_match_line:
+ matches.append(match.sale_id.id)
+ matches = list(set(matches))
+ po.matches_so = matches
def _prepare_picking(self):
if not self.group_id: