|
|
@@ -11,7 +11,7 @@ class AccountVoucher(models.Model):
|
|
|
store=True
|
|
|
)
|
|
|
|
|
|
- @api.depends('amount')
|
|
|
+ @api.depends('amount', 'state')
|
|
|
def _compute_comision(self):
|
|
|
|
|
|
param = self.env['ir.config_parameter'].get_param(
|
|
|
@@ -21,7 +21,7 @@ class AccountVoucher(models.Model):
|
|
|
porcentaje = float(param)
|
|
|
|
|
|
for rec in self:
|
|
|
- if rec.amount:
|
|
|
+ if rec.state == 'posted' and rec.amount:
|
|
|
valor = rec.amount * porcentaje / 100
|
|
|
rec.comision = int(round(valor))
|
|
|
else:
|