Merge lp:~pexego/sepa-tools/several_fixes-6.0 into lp:sepa-tools/6.0
- several_fixes-6.0
- Merge into 6.0
Status: | Needs review |
---|---|
Proposed branch: | lp:~pexego/sepa-tools/several_fixes-6.0 |
Merge into: | lp:sepa-tools/6.0 |
Diff against target: |
326 lines (+52/-41) 6 files modified
account_payment_direct_debit/model/account_invoice.py (+24/-24) account_payment_direct_debit/view/account_invoice.xml (+4/-1) account_payment_direct_debit/workflow/account_invoice.xml (+7/-6) account_payment_pain_base/banking_export_pain.py (+4/-5) account_payment_sepa_credit_transfer/wizard/export_sepa.py (+6/-2) account_payment_sepa_direct_debit/wizard/export_sdd.py (+7/-3) |
To merge this branch: | bzr merge lp:~pexego/sepa-tools/several_fixes-6.0 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
OpenERP SEPA Team | Pending | ||
Review via email: mp+221546@code.launchpad.net |
Commit message
Description of the change
Several fixes:
- The new debit_denied state in account_invoice object, was being created in init function but, it didn't check if state already had been created. Result: several debit_denied states registered in selection column of ir_model_fields, one for each server startup.
- I add reopen button in invoices with debit_denied state like paid state.
- Was impossible go out debit_denied state, because nowhere in code its signal was called, I changed its definition like open to paid behaviour, now, when test_paid is called, the workflow checks if can be moved from debit_denied to paid, newly.
- It was accessing to company, from payment type associated to payment mode, but, company field in payment type is not required because you can want share it between companies, I change it, to check the company in payment mode.
- I change the type of nb_transaction field from integer to char type, because in 6.0 there is a bug with integer function fields and you have to click twice in button to create xml file.
Other small fixes are required to work with these modules, but these are fixed in other merge proposal that we have to merge.
regards
- 11. By Omar (Pexego)
-
[FIX] account_
payment_ pain_base: Changed one except_orm not supported in 6.0 to osv.osv_except
Unmerged revisions
- 11. By Omar (Pexego)
-
[FIX] account_
payment_ pain_base: Changed one except_orm not supported in 6.0 to osv.osv_except - 10. By Omar (Pexego)
-
[FIX] Several fixes
Preview Diff
1 | === modified file 'account_payment_direct_debit/model/account_invoice.py' | |||
2 | --- account_payment_direct_debit/model/account_invoice.py 2014-02-11 18:29:05 +0000 | |||
3 | +++ account_payment_direct_debit/model/account_invoice.py 2014-07-04 14:29:28 +0000 | |||
4 | @@ -2,7 +2,7 @@ | |||
5 | 2 | ############################################################################## | 2 | ############################################################################## |
6 | 3 | # | 3 | # |
7 | 4 | # Copyright (C) 2011 - 2013 Therp BV (<http://therp.nl>). | 4 | # Copyright (C) 2011 - 2013 Therp BV (<http://therp.nl>). |
9 | 5 | # | 5 | # |
10 | 6 | # All other contributions are (C) by their respective contributors | 6 | # All other contributions are (C) by their respective contributors |
11 | 7 | # | 7 | # |
12 | 8 | # All Rights Reserved | 8 | # All Rights Reserved |
13 | @@ -33,12 +33,12 @@ | |||
14 | 33 | 33 | ||
15 | 34 | Invoice workflow: | 34 | Invoice workflow: |
16 | 35 | 35 | ||
18 | 36 | 1 the sale leads to | 36 | 1 the sale leads to |
19 | 37 | 1300 Debtors 100 | 37 | 1300 Debtors 100 |
20 | 38 | 8000 Sales 100 | 38 | 8000 Sales 100 |
21 | 39 | 39 | ||
24 | 40 | Balance: | 40 | Balance: |
25 | 41 | Debtors 2000 | | 41 | Debtors 2000 | |
26 | 42 | Sales | 2000 | 42 | Sales | 2000 |
27 | 43 | 43 | ||
28 | 44 | 2 an external booking takes place | 44 | 2 an external booking takes place |
29 | @@ -59,11 +59,11 @@ | |||
30 | 59 | 59 | ||
31 | 60 | 2000 Transfer account 100 | | 60 | 2000 Transfer account 100 | |
32 | 61 | 1300 Debtors | 100 | 61 | 1300 Debtors | 100 |
34 | 62 | Reconciliation takes place between 1 and 2a. | 62 | Reconciliation takes place between 1 and 2a. |
35 | 63 | The invoice gets set to state 'paid', and 'reconciled' = True | 63 | The invoice gets set to state 'paid', and 'reconciled' = True |
36 | 64 | 64 | ||
37 | 65 | Balance: | 65 | Balance: |
39 | 66 | Debtors 0 | | 66 | Debtors 0 | |
40 | 67 | Transfer account 2000 | | 67 | Transfer account 2000 | |
41 | 68 | Bank 0 | | 68 | Bank 0 | |
42 | 69 | Sales | 2000 | 69 | Sales | 2000 |
43 | @@ -76,7 +76,7 @@ | |||
44 | 76 | Reconciliation takes place between 3a and 2a | 76 | Reconciliation takes place between 3a and 2a |
45 | 77 | 77 | ||
46 | 78 | Balance: | 78 | Balance: |
48 | 79 | Debtors 0 | | 79 | Debtors 0 | |
49 | 80 | Transfer account 0 | | 80 | Transfer account 0 | |
50 | 81 | Bank 2000 | | 81 | Bank 2000 | |
51 | 82 | Sales | 2000 | 82 | Sales | 2000 |
52 | @@ -84,59 +84,59 @@ | |||
53 | 84 | 4 a storno from invoice [1] triggers a new booking on the bank account | 84 | 4 a storno from invoice [1] triggers a new booking on the bank account |
54 | 85 | 1300 Debtors 100 | | 85 | 1300 Debtors 100 | |
55 | 86 | 1100 Bank | 100 | 86 | 1100 Bank | 100 |
57 | 87 | 87 | ||
58 | 88 | Balance: | 88 | Balance: |
60 | 89 | Debtors 100 | | 89 | Debtors 100 | |
61 | 90 | Transfer account 0 | | 90 | Transfer account 0 | |
62 | 91 | Bank 1900 | | 91 | Bank 1900 | |
63 | 92 | Sales | 2000 | 92 | Sales | 2000 |
64 | 93 | 93 | ||
66 | 94 | The reconciliation of 2a is undone. The booking of 2a is reconciled | 94 | The reconciliation of 2a is undone. The booking of 2a is reconciled |
67 | 95 | with the booking of 4 instead. | 95 | with the booking of 4 instead. |
68 | 96 | The payment line attribute 'storno' is set to True and the invoice | 96 | The payment line attribute 'storno' is set to True and the invoice |
69 | 97 | state is no longer 'paid'. | 97 | state is no longer 'paid'. |
70 | 98 | 98 | ||
71 | 99 | Two cases need to be distinguisted: | 99 | Two cases need to be distinguisted: |
72 | 100 | 1) If the storno is a manual storno from the partner, the invoice is set to | 100 | 1) If the storno is a manual storno from the partner, the invoice is set to |
74 | 101 | state 'debit_denied', with 'reconciled' = False | 101 | state 'debit_denied', with 'reconciled' = False |
75 | 102 | This module implements this option by allowing the bank module to call | 102 | This module implements this option by allowing the bank module to call |
77 | 103 | 103 | ||
78 | 104 | netsvc.LocalService("workflow").trg_validate( | 104 | netsvc.LocalService("workflow").trg_validate( |
79 | 105 | uid, 'account.invoice', ids, 'debit_denied', cr) | 105 | uid, 'account.invoice', ids, 'debit_denied', cr) |
80 | 106 | 106 | ||
81 | 107 | 2) If the storno is an error generated by the bank (assumingly non-fatal), | 107 | 2) If the storno is an error generated by the bank (assumingly non-fatal), |
82 | 108 | the invoice is reopened for the next debit run. This is a call to existing | 108 | the invoice is reopened for the next debit run. This is a call to existing |
84 | 109 | 109 | ||
85 | 110 | netsvc.LocalService("workflow").trg_validate( | 110 | netsvc.LocalService("workflow").trg_validate( |
86 | 111 | uid, 'account.invoice', ids, 'open_test', cr) | 111 | uid, 'account.invoice', ids, 'open_test', cr) |
87 | 112 | 112 | ||
88 | 113 | Should also be adding a log entry on the invoice for tracing purposes | 113 | Should also be adding a log entry on the invoice for tracing purposes |
89 | 114 | 114 | ||
91 | 115 | self._log_event(cr, uid, ids, -1.0, 'Debit denied') | 115 | self._log_event(cr, uid, ids, -1.0, 'Debit denied') |
92 | 116 | 116 | ||
93 | 117 | If not for that funny comment | 117 | If not for that funny comment |
94 | 118 | "#TODO: implement messages system" in account/invoice.py | 118 | "#TODO: implement messages system" in account/invoice.py |
95 | 119 | 119 | ||
96 | 120 | Repeating non-fatal fatal errors need to be dealt with manually by checking | 120 | Repeating non-fatal fatal errors need to be dealt with manually by checking |
97 | 121 | open invoices with a matured invoice- or due date. | 121 | open invoices with a matured invoice- or due date. |
99 | 122 | """ | 122 | """ |
100 | 123 | 123 | ||
101 | 124 | class account_invoice(osv.osv): | 124 | class account_invoice(osv.osv): |
102 | 125 | _inherit = "account.invoice" | 125 | _inherit = "account.invoice" |
103 | 126 | 126 | ||
104 | 127 | def __init__(self, pool, cr): | 127 | def __init__(self, pool, cr): |
106 | 128 | """ | 128 | """ |
107 | 129 | Adding a state to the hardcoded state list of the inherited | 129 | Adding a state to the hardcoded state list of the inherited |
109 | 130 | model. The alternative is duplicating the field definition | 130 | model. The alternative is duplicating the field definition |
110 | 131 | in columns but only one module can do that! | 131 | in columns but only one module can do that! |
111 | 132 | 132 | ||
112 | 133 | Maybe apply a similar trick when overriding the buttons' 'states' attributes | 133 | Maybe apply a similar trick when overriding the buttons' 'states' attributes |
113 | 134 | in the form view, manipulating the xml in fields_view_get(). | 134 | in the form view, manipulating the xml in fields_view_get(). |
115 | 135 | """ | 135 | """ |
116 | 136 | super(account_invoice, self).__init__(pool, cr) | 136 | super(account_invoice, self).__init__(pool, cr) |
117 | 137 | invoice_obj = pool.get('account.invoice') | 137 | invoice_obj = pool.get('account.invoice') |
120 | 138 | invoice_obj._columns['state'].selection.append( | 138 | if ('debit_denied', 'Debit denied') not in invoice_obj._columns['state'].selection: |
121 | 139 | ('debit_denied', 'Debit denied')) | 139 | invoice_obj._columns['state'].selection.append(('debit_denied', 'Debit denied')) |
122 | 140 | 140 | ||
123 | 141 | def action_debit_denied(self, cr, uid, ids, context=None): | 141 | def action_debit_denied(self, cr, uid, ids, context=None): |
124 | 142 | for invoice_id in ids: | 142 | for invoice_id in ids: |
125 | @@ -144,7 +144,7 @@ | |||
126 | 144 | number = self.read( | 144 | number = self.read( |
127 | 145 | cr, uid, invoice_id, ['number'], context=context)['number'] | 145 | cr, uid, invoice_id, ['number'], context=context)['number'] |
128 | 146 | raise osv.except_osv( | 146 | raise osv.except_osv( |
130 | 147 | _('Error !'), | 147 | _('Error !'), |
131 | 148 | _('You cannot set invoice \'%s\' to state \'debit denied\', ' + | 148 | _('You cannot set invoice \'%s\' to state \'debit denied\', ' + |
132 | 149 | 'as it is still reconciled.') % number) | 149 | 'as it is still reconciled.') % number) |
133 | 150 | self.write(cr, uid, ids, {'state': 'debit_denied'}, context=context) | 150 | self.write(cr, uid, ids, {'state': 'debit_denied'}, context=context) |
134 | @@ -154,13 +154,13 @@ | |||
135 | 154 | return True | 154 | return True |
136 | 155 | 155 | ||
137 | 156 | def test_undo_debit_denied(self, cr, uid, ids, context=None): | 156 | def test_undo_debit_denied(self, cr, uid, ids, context=None): |
139 | 157 | """ | 157 | """ |
140 | 158 | Called from the workflow. Used to unset paid state on | 158 | Called from the workflow. Used to unset paid state on |
142 | 159 | invoices that were paid with bank transfers which are being cancelled | 159 | invoices that were paid with bank transfers which are being cancelled |
143 | 160 | """ | 160 | """ |
144 | 161 | for invoice in self.read(cr, uid, ids, ['reconciled'], context): | 161 | for invoice in self.read(cr, uid, ids, ['reconciled'], context): |
145 | 162 | if not invoice['reconciled']: | 162 | if not invoice['reconciled']: |
146 | 163 | return False | 163 | return False |
147 | 164 | return True | 164 | return True |
148 | 165 | 165 | ||
149 | 166 | account_invoice() | ||
150 | 167 | \ No newline at end of file | 166 | \ No newline at end of file |
151 | 167 | account_invoice() | ||
152 | 168 | 168 | ||
153 | === modified file 'account_payment_direct_debit/view/account_invoice.xml' | |||
154 | --- account_payment_direct_debit/view/account_invoice.xml 2014-02-11 18:29:05 +0000 | |||
155 | +++ account_payment_direct_debit/view/account_invoice.xml 2014-07-04 14:29:28 +0000 | |||
156 | @@ -7,7 +7,7 @@ | |||
157 | 7 | <field name="inherit_id" ref="account.invoice_form"/> | 7 | <field name="inherit_id" ref="account.invoice_form"/> |
158 | 8 | <field name="arch" type="xml"> | 8 | <field name="arch" type="xml"> |
159 | 9 | <data> | 9 | <data> |
161 | 10 | <!-- | 10 | <!-- |
162 | 11 | Add new state 'debit_denied' to applicable buttons. | 11 | Add new state 'debit_denied' to applicable buttons. |
163 | 12 | Maybe apply trick in fields_view_get instead, for | 12 | Maybe apply trick in fields_view_get instead, for |
164 | 13 | better compatibility with other modules? | 13 | better compatibility with other modules? |
165 | @@ -19,6 +19,9 @@ | |||
166 | 19 | <button name="invoice_debit_denied" states="paid" | 19 | <button name="invoice_debit_denied" states="paid" |
167 | 20 | string="Debit Denied" icon="gtk-cancel"/> | 20 | string="Debit Denied" icon="gtk-cancel"/> |
168 | 21 | </button> | 21 | </button> |
169 | 22 | <button name="%(account.action_account_state_open)d" position="replace"> | ||
170 | 23 | <button name="%(account.action_account_state_open)d" type='action' string='Re-Open' states='paid,debit_denied' icon="gtk-convert" groups="base.group_no_one"/> | ||
171 | 24 | </button> | ||
172 | 22 | </data> | 25 | </data> |
173 | 23 | </field> | 26 | </field> |
174 | 24 | </record> | 27 | </record> |
175 | 25 | 28 | ||
176 | === modified file 'account_payment_direct_debit/workflow/account_invoice.xml' | |||
177 | --- account_payment_direct_debit/workflow/account_invoice.xml 2014-02-11 18:29:05 +0000 | |||
178 | +++ account_payment_direct_debit/workflow/account_invoice.xml 2014-07-04 14:29:28 +0000 | |||
179 | @@ -8,7 +8,7 @@ | |||
180 | 8 | <field name="kind">function</field> | 8 | <field name="kind">function</field> |
181 | 9 | </record> | 9 | </record> |
182 | 10 | <record id="paid_to_debit_denied" model="workflow.transition"> | 10 | <record id="paid_to_debit_denied" model="workflow.transition"> |
184 | 11 | <!-- | 11 | <!-- |
185 | 12 | Set an invoice to state debit denied, either manually | 12 | Set an invoice to state debit denied, either manually |
186 | 13 | or by confirming a bank statement line that constitutes | 13 | or by confirming a bank statement line that constitutes |
187 | 14 | a fatal storno | 14 | a fatal storno |
188 | @@ -18,7 +18,7 @@ | |||
189 | 18 | <field name="signal">invoice_debit_denied</field> | 18 | <field name="signal">invoice_debit_denied</field> |
190 | 19 | </record> | 19 | </record> |
191 | 20 | <record id="open_test_to_debit_denied" model="workflow.transition"> | 20 | <record id="open_test_to_debit_denied" model="workflow.transition"> |
193 | 21 | <!-- | 21 | <!-- |
194 | 22 | A storno leads to unreconciling the move line, which | 22 | A storno leads to unreconciling the move line, which |
195 | 23 | reopens the invoice. We need to allow a transition from | 23 | reopens the invoice. We need to allow a transition from |
196 | 24 | this state to the debit denied state if the storno is fatal. | 24 | this state to the debit denied state if the storno is fatal. |
197 | @@ -28,17 +28,18 @@ | |||
198 | 28 | <field name="signal">invoice_debit_denied</field> | 28 | <field name="signal">invoice_debit_denied</field> |
199 | 29 | </record> | 29 | </record> |
200 | 30 | <record id="debit_denied_to_paid" model="workflow.transition"> | 30 | <record id="debit_denied_to_paid" model="workflow.transition"> |
202 | 31 | <!-- | 31 | <!-- |
203 | 32 | Cancel a bank statement line that constitutes a fatal | 32 | Cancel a bank statement line that constitutes a fatal |
204 | 33 | storno | 33 | storno |
205 | 34 | --> | 34 | --> |
206 | 35 | <field name="act_from" ref="act_debit_denied"/> | 35 | <field name="act_from" ref="act_debit_denied"/> |
207 | 36 | <field name="act_to" ref="account.act_paid"/> | 36 | <field name="act_to" ref="account.act_paid"/> |
210 | 37 | <field name="condition">test_undo_debit_denied()</field> | 37 | <field name="trigger_model">account.move.line</field> |
211 | 38 | <field name="signal">undo_debit_denied</field> | 38 | <field name="trigger_expr_id">move_line_id_payment_get()</field> |
212 | 39 | <field name="condition">test_paid()</field> | ||
213 | 39 | </record> | 40 | </record> |
214 | 40 | <record id="debit_denied_to_open" model="workflow.transition"> | 41 | <record id="debit_denied_to_open" model="workflow.transition"> |
216 | 41 | <!-- | 42 | <!-- |
217 | 42 | Allow the user to manually reset a debit denied status | 43 | Allow the user to manually reset a debit denied status |
218 | 43 | on a paid invoice (but only after manually unreconciling | 44 | on a paid invoice (but only after manually unreconciling |
219 | 44 | the invoice) | 45 | the invoice) |
220 | 45 | 46 | ||
221 | === modified file 'account_payment_pain_base/banking_export_pain.py' | |||
222 | --- account_payment_pain_base/banking_export_pain.py 2014-02-11 18:29:05 +0000 | |||
223 | +++ account_payment_pain_base/banking_export_pain.py 2014-07-04 14:29:28 +0000 | |||
224 | @@ -154,7 +154,6 @@ | |||
225 | 154 | 'file_id': file_id, | 154 | 'file_id': file_id, |
226 | 155 | 'state': 'finish', | 155 | 'state': 'finish', |
227 | 156 | }, context=context) | 156 | }, context=context) |
228 | 157 | |||
229 | 158 | action = { | 157 | action = { |
230 | 159 | 'name': 'SEPA File', | 158 | 'name': 'SEPA File', |
231 | 160 | 'type': 'ir.actions.act_window', | 159 | 'type': 'ir.actions.act_window', |
232 | @@ -264,10 +263,10 @@ | |||
233 | 264 | initiating_party_identifier = self.pool.get('res.company').\ | 263 | initiating_party_identifier = self.pool.get('res.company').\ |
234 | 265 | _get_initiating_party_identifier( | 264 | _get_initiating_party_identifier( |
235 | 266 | cr, uid, | 265 | cr, uid, |
237 | 267 | gen_args['sepa_export'].payment_order_ids[0].mode.type.company_id.id, | 266 | gen_args['sepa_export'].payment_order_ids[0].mode.company_id.id, |
238 | 268 | context=context) | 267 | context=context) |
239 | 269 | initiating_party_issuer = gen_args['sepa_export'].\ | 268 | initiating_party_issuer = gen_args['sepa_export'].\ |
241 | 270 | payment_order_ids[0].mode.type.company_id.initiating_party_issuer | 269 | payment_order_ids[0].mode.company_id.initiating_party_issuer |
242 | 271 | if initiating_party_identifier and initiating_party_issuer: | 270 | if initiating_party_identifier and initiating_party_issuer: |
243 | 272 | iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') | 271 | iniparty_id = etree.SubElement(initiating_party_1_8, 'Id') |
244 | 273 | iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') | 272 | iniparty_org_id = etree.SubElement(iniparty_id, 'OrgId') |
245 | @@ -295,7 +294,7 @@ | |||
246 | 295 | party_agent_bic = etree.SubElement( | 294 | party_agent_bic = etree.SubElement( |
247 | 296 | party_agent_institution, gen_args.get('bic_xml_tag')) | 295 | party_agent_institution, gen_args.get('bic_xml_tag')) |
248 | 297 | party_agent_bic.text = bic | 296 | party_agent_bic.text = bic |
250 | 298 | except except_orm: | 297 | except osv.except_osv: |
251 | 299 | if order == 'C': | 298 | if order == 'C': |
252 | 300 | if iban[0:2] != gen_args['initiating_party_country_code']: | 299 | if iban[0:2] != gen_args['initiating_party_country_code']: |
253 | 301 | raise osv.except_osv( | 300 | raise osv.except_osv( |
254 | @@ -437,5 +436,5 @@ | |||
255 | 437 | csi_scheme_name, 'Prtry') | 436 | csi_scheme_name, 'Prtry') |
256 | 438 | csi_scheme_name_proprietary.text = scheme_name_proprietary | 437 | csi_scheme_name_proprietary.text = scheme_name_proprietary |
257 | 439 | return True | 438 | return True |
259 | 440 | 439 | ||
260 | 441 | banking_export_pain() | 440 | banking_export_pain() |
261 | 442 | 441 | ||
262 | === modified file 'account_payment_sepa_credit_transfer/wizard/export_sepa.py' | |||
263 | --- account_payment_sepa_credit_transfer/wizard/export_sepa.py 2014-02-11 18:29:05 +0000 | |||
264 | +++ account_payment_sepa_credit_transfer/wizard/export_sepa.py 2014-07-04 14:29:28 +0000 | |||
265 | @@ -58,7 +58,7 @@ | |||
266 | 58 | "to be borne by the creditor. Borne by debtor : all transaction " | 58 | "to be borne by the creditor. Borne by debtor : all transaction " |
267 | 59 | "charges are to be borne by the debtor."), | 59 | "charges are to be borne by the debtor."), |
268 | 60 | 'nb_transactions': fields.related( | 60 | 'nb_transactions': fields.related( |
270 | 61 | 'file_id', 'nb_transactions', type='integer', | 61 | 'file_id', 'nb_transactions', type='char', |
271 | 62 | string='Number of Transactions', readonly=True), | 62 | string='Number of Transactions', readonly=True), |
272 | 63 | 'total_amount': fields.related( | 63 | 'total_amount': fields.related( |
273 | 64 | 'file_id', 'total_amount', type='float', string='Total Amount', | 64 | 'file_id', 'total_amount', type='float', string='Total Amount', |
274 | @@ -251,7 +251,7 @@ | |||
275 | 251 | self.generate_party_block( | 251 | self.generate_party_block( |
276 | 252 | cr, uid, credit_transfer_transaction_info_2_27, 'Cdtr', | 252 | cr, uid, credit_transfer_transaction_info_2_27, 'Cdtr', |
277 | 253 | 'C', 'line.partner_id.name', 'line.bank_id.iban', | 253 | 'C', 'line.partner_id.name', 'line.bank_id.iban', |
279 | 254 | 'line.bank_id.bank.bic', line.bank_id.id, | 254 | 'line.bank_id.bank.bic', line.bank_id.id, |
280 | 255 | {'line': line}, gen_args, context=context) | 255 | {'line': line}, gen_args, context=context) |
281 | 256 | 256 | ||
282 | 257 | self.generate_remittance_info_block( | 257 | self.generate_remittance_info_block( |
283 | @@ -268,6 +268,10 @@ | |||
284 | 268 | else: | 268 | else: |
285 | 269 | nb_of_transactions_1_6.text = str(transactions_count_1_6) | 269 | nb_of_transactions_1_6.text = str(transactions_count_1_6) |
286 | 270 | control_sum_1_7.text = '%.2f' % amount_control_sum_1_7 | 270 | control_sum_1_7.text = '%.2f' % amount_control_sum_1_7 |
287 | 271 | # LLamada a set_done en payment.order para hacer movimientos contables del pago | ||
288 | 272 | # cuando create_account_moves = 'direct-payment' | ||
289 | 273 | payment_order_ids = context.get('active_ids', []) | ||
290 | 274 | self.pool.get('payment.order').set_done(cr, uid, payment_order_ids, context) | ||
291 | 271 | return self.finalize_sepa_file_creation( | 275 | return self.finalize_sepa_file_creation( |
292 | 272 | cr, uid, ids, xml_root, total_amount, transactions_count_1_6, | 276 | cr, uid, ids, xml_root, total_amount, transactions_count_1_6, |
293 | 273 | gen_args, context=context) | 277 | gen_args, context=context) |
294 | 274 | 278 | ||
295 | === modified file 'account_payment_sepa_direct_debit/wizard/export_sdd.py' | |||
296 | --- account_payment_sepa_direct_debit/wizard/export_sdd.py 2014-02-11 18:29:05 +0000 | |||
297 | +++ account_payment_sepa_direct_debit/wizard/export_sdd.py 2014-07-04 14:29:28 +0000 | |||
298 | @@ -58,7 +58,7 @@ | |||
299 | 58 | "borne by the creditor. Borne by debtor : all transaction " | 58 | "borne by the creditor. Borne by debtor : all transaction " |
300 | 59 | "charges are to be borne by the debtor."), | 59 | "charges are to be borne by the debtor."), |
301 | 60 | 'nb_transactions': fields.related( | 60 | 'nb_transactions': fields.related( |
303 | 61 | 'file_id', 'nb_transactions', type='integer', | 61 | 'file_id', 'nb_transactions', type='char', |
304 | 62 | string='Number of Transactions', readonly=True), | 62 | string='Number of Transactions', readonly=True), |
305 | 63 | 'total_amount': fields.related( | 63 | 'total_amount': fields.related( |
306 | 64 | 'file_id', 'total_amount', type='float', string='Total Amount', | 64 | 'file_id', 'total_amount', type='float', string='Total Amount', |
307 | @@ -400,7 +400,11 @@ | |||
308 | 400 | control_sum_2_5.text = '%.2f' % amount_control_sum_2_5 | 400 | control_sum_2_5.text = '%.2f' % amount_control_sum_2_5 |
309 | 401 | nb_of_transactions_1_6.text = str(transactions_count_1_6) | 401 | nb_of_transactions_1_6.text = str(transactions_count_1_6) |
310 | 402 | control_sum_1_7.text = '%.2f' % amount_control_sum_1_7 | 402 | control_sum_1_7.text = '%.2f' % amount_control_sum_1_7 |
312 | 403 | 403 | ||
313 | 404 | # LLamada a set_done en payment.order para hacer movimientos contables del adeudo | ||
314 | 405 | # cuando create_account_moves = 'direct-payment' | ||
315 | 406 | payment_order_ids = context.get('active_ids', []) | ||
316 | 407 | self.pool.get('payment.order').set_done(cr, uid, payment_order_ids, context) | ||
317 | 404 | return self.finalize_sepa_file_creation( | 408 | return self.finalize_sepa_file_creation( |
318 | 405 | cr, uid, ids, xml_root, total_amount, transactions_count_1_6, | 409 | cr, uid, ids, xml_root, total_amount, transactions_count_1_6, |
319 | 406 | gen_args, context=context) | 410 | gen_args, context=context) |
320 | @@ -451,4 +455,4 @@ | |||
321 | 451 | 'sepa_migrated': True, | 455 | 'sepa_migrated': True, |
322 | 452 | }, context=context) | 456 | }, context=context) |
323 | 453 | return {'type': 'ir.actions.act_window_close'} | 457 | return {'type': 'ir.actions.act_window_close'} |
324 | 454 | banking_export_sdd_wizard() | ||
325 | 455 | \ No newline at end of file | 458 | \ No newline at end of file |
326 | 459 | banking_export_sdd_wizard() |