Skip to content

Commit

Permalink
[FIX] pain modules not working
Browse files Browse the repository at this point in the history
Fix pain modules problems
  • Loading branch information
ecino committed Jun 22, 2023
1 parent 1803872 commit 8046648
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion l10n_ch_pain_base/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def _prepare_payment_line_vals(self, payment_order):
vals = super()._prepare_payment_line_vals(payment_order)
if (

Check warning on line 12 in l10n_ch_pain_base/models/account_move_line.py

View check run for this annotation

Codecov / codecov/patch

l10n_ch_pain_base/models/account_move_line.py#L11-L12

Added lines #L11 - L12 were not covered by tests
self.move_id
and self.move_id._is_isr_reference()
and self.move_id._has_isr_ref()
and self.move_id.partner_bank_id
):
if self.move_id.partner_bank_id._is_qr_iban():
Expand Down
6 changes: 3 additions & 3 deletions l10n_ch_pain_base/models/account_payment_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def generate_party_agent(
self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None
):
if gen_args.get("pain_flavor") == "pain.001.001.03.ch.02" and bank_line:
if bank_line.local_instrument == "CH01":
if bank_line.payment_line_ids[:1].local_instrument == "CH01":

Check warning on line 79 in l10n_ch_pain_base/models/account_payment_order.py

View check run for this annotation

Codecov / codecov/patch

l10n_ch_pain_base/models/account_payment_order.py#L78-L79

Added lines #L78 - L79 were not covered by tests
# Don't set the creditor agent on ISR/CH01 payments
return True
elif not partner_bank.bank_bic:
Expand Down Expand Up @@ -104,7 +104,7 @@ def generate_party_acc_number(
if (

Check warning on line 104 in l10n_ch_pain_base/models/account_payment_order.py

View check run for this annotation

Codecov / codecov/patch

l10n_ch_pain_base/models/account_payment_order.py#L104

Added line #L104 was not covered by tests
gen_args.get("pain_flavor") == "pain.001.001.03.ch.02"
and bank_line
and bank_line.local_instrument == "CH01"
and bank_line.payment_line_ids[:1].local_instrument == "CH01"
):
if not partner_bank.l10n_ch_postal:
raise UserError(

Check warning on line 110 in l10n_ch_pain_base/models/account_payment_order.py

View check run for this annotation

Codecov / codecov/patch

l10n_ch_pain_base/models/account_payment_order.py#L109-L110

Added lines #L109 - L110 were not covered by tests
Expand Down Expand Up @@ -159,7 +159,7 @@ def generate_address_block(self, parent_node, partner, gen_args):

@api.model
def generate_remittance_info_block(self, parent_node, line, gen_args):
if line.communication_type == "qrr":
if line.payment_line_ids[:1].communication_type == "qrr":
remittance_info = etree.SubElement(parent_node, "RmtInf")
remittance_info_structured = etree.SubElement(remittance_info, "Strd")
creditor_ref_information = etree.SubElement(

Check warning on line 165 in l10n_ch_pain_base/models/account_payment_order.py

View check run for this annotation

Codecov / codecov/patch

l10n_ch_pain_base/models/account_payment_order.py#L162-L165

Added lines #L162 - L165 were not covered by tests
Expand Down

0 comments on commit 8046648

Please sign in to comment.