From efa51f6b1c5254996db90a90468241da303a7e21 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Mon, 6 Nov 2023 08:40:38 +0700 Subject: new table of partner commision --- indoteknik_custom/models/commision.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/indoteknik_custom/models/commision.py b/indoteknik_custom/models/commision.py index 315e47f6..6d61de4c 100644 --- a/indoteknik_custom/models/commision.py +++ b/indoteknik_custom/models/commision.py @@ -6,6 +6,17 @@ import logging _logger = logging.getLogger(__name__) +class CustomerRebate(models.Model): + _name = 'customer.rebate' + _order = 'id desc' + _inherit = ['mail.thread'] + + partner_id = fields.Many2one('res.partner', string='Customer') + date_from = fields.Date(string='Date From', required=True) + date_to = fields.Date(string='Date To', required=True) + target_quarter = fields.Float(string='Target/Quarter') + + class CustomerCommision(models.Model): _name = 'customer.commision' _order = 'id desc' @@ -26,6 +37,14 @@ class CustomerCommision(models.Model): commision_percent = fields.Float(string='Commision %', tracking=3) commision_amt = fields.Float(string='Commision Amount', tracking=3) total_dpp = fields.Float(string='Total DPP', compute='_compute_total_dpp') + commision_type = fields.Selection([ + ('fee', 'Fee'), + ('cashback', 'Cashback'), + ('rebate', 'Rebate'), + ], string='Commision Type') + + # add status for type of commision, fee, rebate / cashback + # include child or not? @api.constrains('commision_percent') def _onchange_commision_percent(self): -- cgit v1.2.3