summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-06-12 11:12:53 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-06-12 11:12:53 +0700
commitf8469c711824f39facf01c493a77235d948b0779 (patch)
treea73762a34c862ee390907cffb920e477358b3237
parente035d5ce7097daf04fbe289298a5950108a54002 (diff)
parent590decb22298c53e13265c49be568731f8275f9f (diff)
Merge branch 'production' of bitbucket.org:altafixco/indoteknik-addons into production
-rwxr-xr-xindoteknik_custom/models/purchase_order.py9
-rwxr-xr-xindoteknik_custom/views/purchase_order.xml2
2 files changed, 11 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 8bef8274..5d28e5a1 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:
diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml
index 47dc7a15..09744f5f 100755
--- a/indoteknik_custom/views/purchase_order.xml
+++ b/indoteknik_custom/views/purchase_order.xml
@@ -132,6 +132,7 @@
<field name="create_date" position="after">
<field name="approval_status" />
<field name="responsible_ids" widget="many2many_tags" optional="hide"/>
+ <field name="matches_so" widget="many2many_tags" optional="hide"/>
</field>
</field>
</record>
@@ -148,6 +149,7 @@
<field name="note_description" optional="hide"/>
<field name="sale_order_id" optional="hide"/>
<field name="responsible_ids" widget="many2many_tags" optional="hide"/>
+ <field name="matches_so" widget="many2many_tags" optional="hide"/>
</field>
</field>
</record>