[FIX] res_partner_bank: set error flag for qr
Problem: With Switzerland accounting localization installed, the user is unable to create vendor payments for non-Swiss contacts or contacts with non-IBAN accounts because a qr code will try to generate due to compute_qr_code. Eventually, an error will be thrown since the raises_error param for _eligible_for_qr_code is True by default. When _build_qr_code_vals calls _eligible_for_qr_code, it did not explicitly pass the raises_error arg. Thus, instead of returning None, an error is thrown instead, blocking futher operations. Proposed Solution: Method _build_qr_code_vals should pass raises_error = not silent_error to _eligible_for_qr_code. There is an inverse relation between silent_error and raises_error. By default, silent_error is True so it's safe to assume that raises_error = False because the compute for the qr code on payments should not raise any error. This fix will resolve the issue when computing the qr code for payments while being fluid with other method calls. closes odoo/odoo#114256 X-original-commit: 45d34a8630918abe2f988f7ed0e0df153a3edd51 Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
@@ -55,7 +55,7 @@ class ResPartnerBank(models.Model):
|
||||
available_qr_methods = self.get_available_qr_methods_in_sequence()
|
||||
candidate_methods = qr_method and [(qr_method, dict(available_qr_methods)[qr_method])] or available_qr_methods
|
||||
for candidate_method, candidate_name in candidate_methods:
|
||||
if self._eligible_for_qr_code(candidate_method, debtor_partner, currency):
|
||||
if self._eligible_for_qr_code(candidate_method, debtor_partner, currency, not silent_errors):
|
||||
error_message = self._check_for_qr_code_errors(candidate_method, amount, currency, debtor_partner, free_communication, structured_communication)
|
||||
|
||||
if not error_message:
|
||||
|
||||
Reference in New Issue
Block a user