summaryrefslogtreecommitdiff
path: root/indoteknik_custom
diff options
context:
space:
mode:
authorRafi Zadanly <zadanlyr@gmail.com>2024-04-26 14:59:17 +0700
committerRafi Zadanly <zadanlyr@gmail.com>2024-04-26 14:59:17 +0700
commit697e3397eecca7e84f05965d1f8c4b37aedfb0c6 (patch)
tree3bb0a6211511052826253866148de537d8e55d63 /indoteknik_custom
parentba40250a928092e06136ac9f40c5be612b0c332e (diff)
Update sale order API with partner's sales
Update CRM Lead when cancel PO to Nabila
Diffstat (limited to 'indoteknik_custom')
-rwxr-xr-xindoteknik_custom/models/crm_lead.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/indoteknik_custom/models/crm_lead.py b/indoteknik_custom/models/crm_lead.py
index e8721142..9ffd607c 100755
--- a/indoteknik_custom/models/crm_lead.py
+++ b/indoteknik_custom/models/crm_lead.py
@@ -23,6 +23,15 @@ class CrmLead(models.Model):
operator_name = fields.Char('Operator Name', help='Operator yang membalas')
order_id = fields.Many2one('sale.order', string='Sales Order', help='Link ke sales order id')
+ @api.model
+ def create(self, vals):
+ rec = super(CrmLead, self).create(vals)
+
+ if rec.email_from == 'api.noreply@altama.co.id' and rec.name.startswith('INDOTEKNIK|ODOO|'):
+ rec.user_id = 20 # User ID: Nabila Rahmawati
+
+ return rec
+
@api.onchange('user_id')
def _change_salesperson_so(self):
if self.order_id: