mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
[IMP] hr_commission: extended ahead of timesheet based commission
* Allow invoice to see commission it is deriving amount for. This allows for basing on amounts that may depend on the employee or contract config. * Prevent making commissions if the employee rate or admin rates are not set. * Updated views to work in both CE and EE
This commit is contained in:
@@ -36,7 +36,7 @@ class AccountMove(models.Model):
|
||||
self.env['hr.commission'].invoice_paid(self)
|
||||
return res
|
||||
|
||||
def amount_for_commission(self):
|
||||
def amount_for_commission(self, commission=None):
|
||||
if hasattr(self, 'margin') and self.company_id.commission_amount_type == 'on_invoice_margin':
|
||||
sign = -1 if self.move_type in ['in_refund', 'out_refund'] else 1
|
||||
return self.margin * sign
|
||||
|
||||
Reference in New Issue
Block a user