changeset 037a536a9017 in modules/sale_advance_payment:default
details:
https://hg.tryton.org/modules/sale_advance_payment?cmd=changeset;node=037a536a9017
description:
Use description for FormulaError
The rec_name is not in the depends and also it is not updated when
editing the
record. So it is better to use directly the description field.
issue10015
review347341002
diffstat:
sale.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (21 lines):
diff -r 51a67f6336a3 -r 037a536a9017 sale.py
--- a/sale.py Sat Dec 19 17:08:46 2020 +0100
+++ b/sale.py Fri Jan 29 00:08:19 2021 +0100
@@ -78,7 +78,7 @@
"- total_amount: The total amount of the sale.\n"
"- untaxed_amount: The total untaxed amount of the sale.")
- @fields.depends('formula')
+ @fields.depends('formula', 'description')
def pre_validate(self, **names):
super(AdvancePaymentTermLine, self).pre_validate()
names['total_amount'] = names['untaxed_amount'] = 0
@@ -89,7 +89,7 @@
raise FormulaError(
gettext('sale_advance_payment.msg_term_line_invalid_formula',
formula=self.formula,
- term_line=self.rec_name,
+ term_line=self.description or '',
exception=exception)) from exception
def get_compute_amount_context(self, **names):