summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xindoteknik_custom/models/sale_monitoring.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/indoteknik_custom/models/sale_monitoring.py b/indoteknik_custom/models/sale_monitoring.py
index e3959da0..cfbe6d78 100755
--- a/indoteknik_custom/models/sale_monitoring.py
+++ b/indoteknik_custom/models/sale_monitoring.py
@@ -26,7 +26,7 @@ class SaleMonitoring(models.Model):
('info_sales', 'Info Sales'),
('info_vendor', 'Info Vendor'),
('penggabungan', 'Penggabungan'),
- ], string="Note")
+ ], string="Note", compute='compute_note')
note = fields.Char(string="Note Detail", compute='compute_note_detail')
purchase_representative_id = fields.Many2one('res.users', string="Purchase Representative", readonly=True, compute='compute_purchase_representative')
@@ -44,6 +44,14 @@ class SaleMonitoring(models.Model):
sale.purchase_representative_id = user_id
+ def compute_note(self):
+ for sale in self:
+ lines = self.env['sale.order.line'].search([
+ ('order_id', '=', sale.sale_order_id.id),
+ ('note', '!=', False)
+ ], limit=1)
+
+ sale.note_so_line = lines.note
def compute_note_detail(self):
for sale in self: