mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
Merge branch 'imp/13.0/hr_commission__untaxed_option' into '13.0'
imp/13.0/hr_commission__untaxed_option into 13.0 See merge request hibou-io/hibou-odoo/suite!914
This commit is contained in:
@@ -37,10 +37,11 @@ class AccountMove(models.Model):
|
||||
return res
|
||||
|
||||
def amount_for_commission(self):
|
||||
# TODO Should toggle in Config Params
|
||||
if hasattr(self, 'margin') and self.company_id.commission_amount_type == 'on_invoice_margin':
|
||||
sign = -1 if self.type in ['in_refund', 'out_refund'] else 1
|
||||
return self.margin * sign
|
||||
elif self.company_id.commission_amount_type == 'on_invoice_untaxed':
|
||||
return self.amount_untaxed_signed
|
||||
return self.amount_total_signed
|
||||
|
||||
def action_cancel(self):
|
||||
|
||||
@@ -15,4 +15,5 @@ class ResCompany(models.Model):
|
||||
commission_amount_type = fields.Selection([
|
||||
('on_invoice_margin', 'On Invoice Margin'),
|
||||
('on_invoice_total', 'On Invoice Total'),
|
||||
('on_invoice_untaxed', 'On Invoice Total Tax Excluded'),
|
||||
], string='Commission Base', default='on_invoice_margin')
|
||||
|
||||
Reference in New Issue
Block a user