mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[REF] - Use method _get_quantity_to_invoice.
This commit is contained in:
committed by
Víctor Martínez
parent
0caeffffa6
commit
ba3e49c6b8
@@ -23,12 +23,18 @@ class ContractLineFormula(models.Model):
|
||||
'line': self.env['account.analytic.invoice.line'],
|
||||
'contract': self.env['account.analytic.account'],
|
||||
'invoice': self.env['account.invoice'],
|
||||
'quantity': 0,
|
||||
'period_first_date': False,
|
||||
'period_last_date': False,
|
||||
'invoice_date': False,
|
||||
}
|
||||
try:
|
||||
safe_eval(
|
||||
self.code.strip(), eval_context, mode="exec", nocopy=True)
|
||||
self.code.strip(), eval_context, mode="exec", nocopy=True
|
||||
)
|
||||
except Exception as e:
|
||||
raise exceptions.ValidationError(
|
||||
_('Error evaluating code.\nDetails: %s') % e)
|
||||
_('Error evaluating code.\nDetails: %s') % e
|
||||
)
|
||||
if 'result' not in eval_context:
|
||||
raise exceptions.ValidationError(_('No valid result returned.'))
|
||||
|
||||
Reference in New Issue
Block a user