|
3 | 3 |
|
4 | 4 | from lxml import etree
|
5 | 5 |
|
6 |
| -from odoo import _, api, models |
7 |
| -from odoo.exceptions import UserError |
| 6 | +from odoo import api, models |
8 | 7 |
|
9 | 8 |
|
10 | 9 | class AccountPaymentOrder(models.Model):
|
@@ -71,66 +70,6 @@ def generate_start_payment_info_block(
|
71 | 70 | gen_args,
|
72 | 71 | )
|
73 | 72 |
|
74 |
| - @api.model |
75 |
| - def generate_party_agent( |
76 |
| - self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None |
77 |
| - ): |
78 |
| - if gen_args.get("pain_flavor") == "pain.001.001.03.ch.02" and bank_line: |
79 |
| - if bank_line.payment_line_ids[:1].local_instrument == "CH01": |
80 |
| - # Don't set the creditor agent on ISR/CH01 payments |
81 |
| - return True |
82 |
| - elif not partner_bank.bank_bic: |
83 |
| - raise UserError( |
84 |
| - _( |
85 |
| - "For pain.001.001.03.ch.02, for non-ISR payments, " |
86 |
| - "the BIC is required on the bank '%(name)s' related to the " |
87 |
| - "bank account '%(account)s'", |
88 |
| - name=partner_bank.bank_id.name, |
89 |
| - account=partner_bank.acc_number, |
90 |
| - ) |
91 |
| - ) |
92 |
| - return super().generate_party_agent( |
93 |
| - parent_node, |
94 |
| - party_type, |
95 |
| - order, |
96 |
| - partner_bank, |
97 |
| - gen_args, |
98 |
| - bank_line=bank_line, |
99 |
| - ) |
100 |
| - |
101 |
| - @api.model |
102 |
| - def generate_party_acc_number( |
103 |
| - self, parent_node, party_type, order, partner_bank, gen_args, bank_line=None |
104 |
| - ): |
105 |
| - if ( |
106 |
| - gen_args.get("pain_flavor") == "pain.001.001.03.ch.02" |
107 |
| - and bank_line |
108 |
| - and bank_line.payment_line_ids[:1].local_instrument == "CH01" |
109 |
| - ): |
110 |
| - if not partner_bank.l10n_ch_postal: |
111 |
| - raise UserError( |
112 |
| - _( |
113 |
| - "The field 'Postal account' is not set on the bank " |
114 |
| - "account '%s'." |
115 |
| - ) |
116 |
| - % partner_bank.acc_number |
117 |
| - ) |
118 |
| - party_account = etree.SubElement(parent_node, "%sAcct" % party_type) |
119 |
| - party_account_id = etree.SubElement(party_account, "Id") |
120 |
| - party_account_other = etree.SubElement(party_account_id, "Othr") |
121 |
| - party_account_other_id = etree.SubElement(party_account_other, "Id") |
122 |
| - party_account_other_id.text = partner_bank.l10n_ch_postal |
123 |
| - return True |
124 |
| - else: |
125 |
| - return super().generate_party_acc_number( |
126 |
| - parent_node, |
127 |
| - party_type, |
128 |
| - order, |
129 |
| - partner_bank, |
130 |
| - gen_args, |
131 |
| - bank_line=bank_line, |
132 |
| - ) |
133 |
| - |
134 | 73 | @api.model
|
135 | 74 | def generate_address_block(self, parent_node, partner, gen_args):
|
136 | 75 | """Generate the piece of the XML corresponding to PstlAdr"""
|
|
0 commit comments