diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2023-08-16 04:51:14 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2023-08-16 04:51:14 +0000 |
| commit | a73c0825a264fc002e7496b07f238f79efd93086 (patch) | |
| tree | 04b170cc3860f82d936b5dcb83451b963c524f95 /indoteknik_custom/models/crm_lead.py | |
| parent | 3a954e59343d2d3a3df5436297f7007008ae62e8 (diff) | |
| parent | 021f7ccc9f7b026e330352d34e695993116bdd99 (diff) | |
Merged in production (pull request #98)
Production
Diffstat (limited to 'indoteknik_custom/models/crm_lead.py')
| -rwxr-xr-x | indoteknik_custom/models/crm_lead.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/indoteknik_custom/models/crm_lead.py b/indoteknik_custom/models/crm_lead.py index e5d9953b..0c38ae56 100755 --- a/indoteknik_custom/models/crm_lead.py +++ b/indoteknik_custom/models/crm_lead.py @@ -1,6 +1,7 @@ from odoo import fields, models, api import logging import random +from odoo.exceptions import AccessError, UserError, ValidationError _logger = logging.getLogger(__name__) @@ -21,7 +22,27 @@ class CrmLead(models.Model): operator_email = fields.Char('Operator Email', help='Operator yang membalas') 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') + reason = fields.Selection([ + ('new_so', 'Diganti SO Baru'), + ('out_stock', 'Stock Tidak Tersedia'), + ('wrong_price', 'Salah Memberikan Informasi Harga'), + ('discontinue', 'Barang Discontinue'), + ('change_of_mind', 'Konsumen Berubah Pikiran'), + ('problematic_items', 'Barang Yang Dibeli Bermasalah'), + ('no_tempo', 'Konsumen Tidak Mendapatkan Tempo'), + ('payment_issues', 'Konsumen Memiliki Masalah Pembayaran'), + ('disagree_shipping', 'Tidak Sepakat Dengan Biaya Kirim'), + ('payment_not_received', 'Pembayaran Belum Diterima'), + ('delivery_time', 'Tidak Sanggup Memenuhi Delivery Time'), + ('fraud_indication', 'Indikasi Penipuan'), + ], string='Reason Mark Lost', tracking=True) + def action_set_lost(self): + result = super(CrmLead, self).action_set_lost() + if not self.reason: + raise UserError('Jika ingin Mark as Lost, Isi Reason nya terlebih dahulu') + return result + @api.onchange('user_id') def _change_salesperson_so(self): if self.order_id: |
