Merge lp:~banking-addons-drivers/banking-addons/direct-debit-refactoring-fosdem into lp:banking-addons

Proposed by Stéphane Bidoul (Acsone)
Status: Superseded
Proposed branch: lp:~banking-addons-drivers/banking-addons/direct-debit-refactoring-fosdem
Merge into: lp:banking-addons
Diff against target: 559 lines (+218/-91)
20 files modified
account_banking_pain_base/banking_export_pain.py (+1/-1)
account_banking_payment/__openerp__.py (+1/-4)
account_banking_payment/model/__init__.py (+0/-3)
account_banking_payment/model/account_payment.py (+0/-9)
account_banking_payment_export/__openerp__.py (+4/-2)
account_banking_payment_export/demo/banking_demo.xml (+43/-0)
account_banking_payment_export/model/__init__.py (+2/-1)
account_banking_payment_export/model/account_move_line.py (+98/-0)
account_banking_payment_export/model/payment_order_create.py (+0/-58)
account_banking_sepa_credit_transfer/__openerp__.py (+1/-0)
account_banking_sepa_credit_transfer/sepa_credit_transfer_demo.xml (+15/-0)
account_banking_sepa_direct_debit/__openerp__.py (+1/-0)
account_banking_sepa_direct_debit/data/payment_type_sdd.xml (+3/-5)
account_banking_sepa_direct_debit/sdd_mandate_view.xml (+1/-1)
account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml (+27/-0)
account_banking_tests/__openerp__.py (+0/-1)
account_direct_debit/__openerp__.py (+4/-1)
account_direct_debit/model/__init__.py (+2/-0)
account_direct_debit/model/account_move_line.py (+3/-5)
account_direct_debit/model/account_payment.py (+12/-0)
To merge this branch: bzr merge lp:~banking-addons-drivers/banking-addons/direct-debit-refactoring-fosdem
Reviewer Review Type Date Requested Status
Stefan Rijnhart (Opener) Needs Fixing
Raphaël Valyi - http://www.akretion.com Approve
Holger Brunn (Therp) code review Approve
Review via email: mp+204391@code.launchpad.net

This proposal has been superseded by a proposal from 2014-02-16.

Commit message

[IMP] direct debit refactoring for less dependencies - Acsone/Akretion sprint at Fosdem 2014

Description of the change

Refactoring of direct debit to pull less dependencies.

Result of a sprint with Akexis de Lattre in a corridor at Fosdem 2014.

In a nutshell, this MP moves the hooks that are necessary for account_direct_debit from account_banking_payment to account_banking_payment_export, resulting in a leaner dependency graph [1].

account_banking_payment (and thus account_banking core) is therefore not necessary anymore for doing direct debit.
account_banking_payment can now be seen as providing two essential functions:
1/ adding the notion of transfer account on payment modes (marking the invoices paid as soon as the payment order is sent)
2/ bridging with the bank statement reconciliation features of account_banking core

IMO, the next step in the refactoring process would be to move 1/ to a stand-alone module.

Other things in this branch:
- removing auto_install=True that we found unnecessary and potentially risky
- demo data by Alexis
- a trivial bug fix
- setting noupdate=1 for the SEPA payment mode types
- allow payment of customer refunds lp:1275478

[1] http://t.co/sWjVgAZdO2

To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

I was doubting about line2bank's signature change, but that seems fine

review: Approve (code review)
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

space lacking between ',' and '0' line 220, but LGTM

review: Approve
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Thanks, looks really good.

About the auto_install values: I think the one in line 103 was a copy/paste error when account_banking_payment_export was split off from account_banking_payment. However, the one in account_banking_payment was always there on purpose as it made sense to install the payment part of account_banking when both account_banking and account_payment were installed. I think it still makes sense with the new dependencies account_banking and account_banking_payment_export, so I'd like to keep the one in line 36.

review: Needs Fixing
Revision history for this message
Stefan Rijnhart (Opener) (stefan-opener) wrote :

Oh, almost missed the files that you move from account_banking_payment to account_direct_debit. This includes the definition of the fields that are used in the integration that the former module accomplishes between the payment order and invoice workflows, and I'm afraid that this causes a severe breakage. If I now have account_banking_payment installed (but not account_direct_debit) I cannot even select invoices on a payment order because "Field 'payment_term_ids' does not exist in object 'browse_record(payment.mode, 1)". And that is just the start.

Any idea how to solve this?

review: Needs Fixing
240. By Stéphane Bidoul (Acsone)

put back auto_install=True in account_banking_payment

https://code.launchpad.net/~banking-addons-drivers/banking-addons/direct-debit-refactoring-fosdem/+merge/204391/comments/483578

241. By Stéphane Bidoul (Acsone)

[MRG] merge Alexis' contribution about payment of customer refunds

Unmerged revisions

241. By Stéphane Bidoul (Acsone)

[MRG] merge Alexis' contribution about payment of customer refunds

240. By Stéphane Bidoul (Acsone)

put back auto_install=True in account_banking_payment

https://code.launchpad.net/~banking-addons-drivers/banking-addons/direct-debit-refactoring-fosdem/+merge/204391/comments/483578

239. By Alexis de Lattre

Add demo data.
Fix a noupdate="0" to noupdate="1"

238. By Alexis de Lattre

FIX crash when adding invoice lines in SEPA Credit Transfer. This bug was linked to the removal of account_banking_payment_export/model/payment_order_create.py in commit revno 230.

237. By Stéphane Bidoul (Acsone)

remove auto_install

236. By Stéphane Bidoul (Acsone)

[IMP] _fix_payment_mode_id is gone

235. By Stéphane Bidoul (Acsone)

[IMP] copyright and documentation

234. By Stéphane Bidoul (Acsone)

[IMP] documentation

233. By Stéphane Bidoul (Acsone)

[FIX] move SEPA direct debit menu entries to a menu that does not depend on the core account_banking

232. By Stéphane Bidoul (Acsone)

[FIX] trivial bug fix

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'account_banking_pain_base/banking_export_pain.py'
2--- account_banking_pain_base/banking_export_pain.py 2014-01-13 12:41:25 +0000
3+++ account_banking_pain_base/banking_export_pain.py 2014-02-16 13:21:01 +0000
4@@ -295,7 +295,7 @@
5 party_agent_bic = etree.SubElement(
6 party_agent_institution, gen_args.get('bic_xml_tag'))
7 party_agent_bic.text = bic
8- except except_orm:
9+ except orm.except_orm:
10 if order == 'C':
11 if iban[0:2] != gen_args['initiating_party_country_code']:
12 raise orm.except_orm(
13
14=== modified file 'account_banking_payment/__openerp__.py'
15--- account_banking_payment/__openerp__.py 2013-11-07 22:22:19 +0000
16+++ account_banking_payment/__openerp__.py 2014-02-16 13:21:01 +0000
17@@ -37,13 +37,10 @@
18 'data': [
19 'view/account_payment.xml',
20 'view/banking_transaction_wizard.xml',
21- 'view/payment_mode.xml',
22- 'view/payment_mode_type.xml',
23- 'view/payment_order_create_view.xml',
24 'workflow/account_payment.xml',
25 ],
26 'description': '''
27- This addon adds payment infrastructure to the Banking Addons.
28+ This addon adds payment reconciliation infrastructure to the Banking Addons.
29
30 * Extends payments for digital banking:
31 + Adapted workflow in payments to reflect banking operations
32
33=== modified file 'account_banking_payment/model/__init__.py'
34--- account_banking_payment/model/__init__.py 2013-11-13 20:53:00 +0000
35+++ account_banking_payment/model/__init__.py 2014-02-16 13:21:01 +0000
36@@ -1,8 +1,5 @@
37 import account_payment
38 import payment_line
39-import payment_mode_type
40-import payment_mode
41-import payment_order_create
42 import banking_import_transaction
43 import banking_transaction_wizard
44 import banking_import_line
45
46=== modified file 'account_banking_payment/model/account_payment.py'
47--- account_banking_payment/model/account_payment.py 2013-11-07 22:22:19 +0000
48+++ account_banking_payment/model/account_payment.py 2014-02-16 13:21:01 +0000
49@@ -104,18 +104,9 @@
50 "execution."
51 )
52 ),
53- 'payment_order_type': fields.selection(
54- [('payment', 'Payment'),('debit', 'Direct debit')],
55- 'Payment order type', required=True,
56- readonly=True, states={'draft': [('readonly', False)]},
57- ),
58 'date_sent': fields.date('Send date', readonly=True),
59 }
60
61- _defaults = {
62- 'payment_order_type': 'payment',
63- }
64-
65 def _write_payment_lines(self, cr, uid, ids, **kwargs):
66 '''
67 ORM method for setting attributes of corresponding payment.line objects.
68
69=== modified file 'account_banking_payment_export/__openerp__.py'
70--- account_banking_payment_export/__openerp__.py 2013-09-11 21:04:40 +0000
71+++ account_banking_payment_export/__openerp__.py 2014-02-16 13:21:01 +0000
72@@ -3,7 +3,8 @@
73 #
74 # Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
75 # (C) 2011 - 2013 Therp BV (<http://therp.nl>).
76-#
77+# (C) 2013 - 2014 ACSONE SA (<http://acsone.eu>).
78+#
79 # All other contributions are (C) by their respective contributors
80 #
81 # All Rights Reserved
82@@ -52,6 +53,7 @@
83 'data/payment_mode_type.xml',
84 'security/ir.model.access.csv',
85 ],
86+ 'demo': ['demo/banking_demo.xml'],
87 'description': '''
88 Infrastructure to export payment orders.
89
90@@ -63,7 +65,7 @@
91 * a better implementation of payment_mode.suitable_bank_types() based on payment.mode.type
92 * the "make payment" button launches a wizard depending on the payment.mode.type
93 * a manual payment mode type is provided as an example, with a default "do nothing" wizard
94+ * a couple of improvements the the payment order creation wizard
95 ''',
96- 'auto_install': True,
97 'installable': True,
98 }
99
100=== added directory 'account_banking_payment_export/demo'
101=== added file 'account_banking_payment_export/demo/banking_demo.xml'
102--- account_banking_payment_export/demo/banking_demo.xml 1970-01-01 00:00:00 +0000
103+++ account_banking_payment_export/demo/banking_demo.xml 2014-02-16 13:21:01 +0000
104@@ -0,0 +1,43 @@
105+<?xml version="1.0" encoding="utf-8"?>
106+
107+<openerp>
108+<data noupdate="1">
109+
110+<record id="bank_fortuneo" model="res.bank">
111+ <field name="name">Fortuneo Banque</field>
112+ <field name="bic">FTNOFRP1XXX</field>
113+ <field name="street">26 avenue des Champs Elysées</field>
114+ <field name="zip">75008</field>
115+ <field name="city">Paris</field>
116+ <field name="country" ref="base.fr"/>
117+</record>
118+
119+<record id="bank_la_banque_postale" model="res.bank">
120+ <field name="name">La Banque Postale</field>
121+ <field name="bic">PSSTFRPPXXX</field>
122+ <field name="street">115 rue de Sèvres</field>
123+ <field name="zip">75007</field>
124+ <field name="city">Paris</field>
125+ <field name="country" ref="base.fr"/>
126+</record>
127+
128+<record id="main_company_iban" model="res.partner.bank">
129+ <field name="acc_number">FR76 4242 4242 4242 4242 4242 424</field>
130+ <field name="state">iban</field>
131+ <field name="bank" ref="bank_la_banque_postale"/>
132+ <field name="partner_id" ref="base.main_partner" />
133+ <field name="bank_name">La Banque Postale</field>
134+ <field name="bank_bic">PSSTFRPPXXX</field>
135+</record>
136+
137+<record id="res_partner_12_iban" model="res.partner.bank">
138+ <field name="acc_number">FR66 1212 1212 1212 1212 1212 121</field>
139+ <field name="state">iban</field>
140+ <field name="bank" ref="bank_fortuneo"/>
141+ <field name="partner_id" ref="base.res_partner_12" />
142+ <field name="bank_name">Fortuneo Banque</field>
143+ <field name="bank_bic">FTNOFRP1XXX</field>
144+</record>
145+
146+</data>
147+</openerp>
148
149=== modified file 'account_banking_payment_export/model/__init__.py'
150--- account_banking_payment_export/model/__init__.py 2013-09-23 17:21:51 +0000
151+++ account_banking_payment_export/model/__init__.py 2014-02-16 13:21:01 +0000
152@@ -1,5 +1,6 @@
153+from . import account_move_line
154 from . import account_payment
155 from . import bank_payment_manual
156 from . import payment_mode
157 from . import payment_mode_type
158-from . import payment_order_create
159\ No newline at end of file
160+from . import payment_order_create
161
162=== added file 'account_banking_payment_export/model/account_move_line.py'
163--- account_banking_payment_export/model/account_move_line.py 1970-01-01 00:00:00 +0000
164+++ account_banking_payment_export/model/account_move_line.py 2014-02-16 13:21:01 +0000
165@@ -0,0 +1,98 @@
166+# -*- coding: utf-8 -*-
167+##############################################################################
168+#
169+# Copyright (C) 2004-2014 OpenERP S.A. (http://www.openerp.com/)
170+# (C) 2014 Akretion (http://www.akretion.com/)
171+#
172+# This program is free software: you can redistribute it and/or modify
173+# it under the terms of the GNU Affero General Public License as
174+# published by the Free Software Foundation, either version 3 of the
175+# License, or (at your option) any later version.
176+#
177+# This program is distributed in the hope that it will be useful,
178+# but WITHOUT ANY WARRANTY; without even the implied warranty of
179+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
180+# GNU Affero General Public License for more details.
181+#
182+# You should have received a copy of the GNU Affero General Public License
183+# along with this program. If not, see <http://www.gnu.org/licenses/>.
184+#
185+##############################################################################
186+
187+from openerp.osv import orm, fields
188+from operator import itemgetter
189+
190+
191+# All the code below aims at fixing one small issue in _to_pay_search()
192+# But _to_pay_search() is the search function of the field 'amount_to_pay'
193+# which is a field.function and these functions are not inheritable in OpenERP.
194+# So we have to inherit the field 'amount_to_pay' and duplicate the related
195+# functions
196+# If the patch that I proposed in this bug report
197+# https://bugs.launchpad.net/openobject-addons/+bug/1275478
198+# is integrated in addons/account_payment, then we will be able to remove this
199+# file. -- Alexis de Lattre
200+class account_move_line(orm.Model):
201+ _inherit = 'account.move.line'
202+
203+ def amount_to_pay(self, cr, uid, ids, name, arg=None, context=None):
204+ """ Return the amount still to pay regarding all the payemnt orders
205+ (excepting cancelled orders)"""
206+ if not ids:
207+ return {}
208+ cr.execute("""SELECT ml.id,
209+ CASE WHEN ml.amount_currency < 0
210+ THEN - ml.amount_currency
211+ ELSE ml.credit
212+ END -
213+ (SELECT coalesce(sum(amount_currency),0)
214+ FROM payment_line pl
215+ INNER JOIN payment_order po
216+ ON (pl.order_id = po.id)
217+ WHERE move_line_id = ml.id
218+ AND po.state != 'cancel') AS amount
219+ FROM account_move_line ml
220+ WHERE id IN %s""", (tuple(ids),))
221+ r = dict(cr.fetchall())
222+ return r
223+
224+ def _to_pay_search(self, cr, uid, obj, name, args, context=None):
225+ if not args:
226+ return []
227+ line_obj = self.pool.get('account.move.line')
228+ query = line_obj._query_get(cr, uid, context={})
229+ where = ' and '.join(map(lambda x: '''(SELECT
230+ CASE WHEN l.amount_currency < 0
231+ THEN - l.amount_currency
232+ ELSE l.credit
233+ END - coalesce(sum(pl.amount_currency), 0)
234+ FROM payment_line pl
235+ INNER JOIN payment_order po ON (pl.order_id = po.id)
236+ WHERE move_line_id = l.id
237+ AND po.state != 'cancel'
238+ ) %(operator)s %%s ''' % {'operator': x[1]}, args))
239+ sql_args = tuple(map(itemgetter(2), args))
240+
241+ cr.execute(('''SELECT id
242+ FROM account_move_line l
243+ WHERE account_id IN (select id
244+ FROM account_account
245+ WHERE type in %s AND active)
246+ AND reconcile_id IS null
247+ AND credit > 0
248+ AND ''' + where + ' and ' + query),
249+ (('payable', 'receivable'),)+sql_args )
250+ # The patch we have compared to the original function in
251+ # addons/account_payment is just above :
252+ # original code : type = 'payable'
253+ # fixed code : type in ('payable', 'receivable')
254+
255+ res = cr.fetchall()
256+ if not res:
257+ return [('id', '=', '0')]
258+ return [('id', 'in', map(lambda x:x[0], res))]
259+
260+ _columns = {
261+ 'amount_to_pay': fields.function(amount_to_pay,
262+ type='float', string='Amount to pay', fnct_search=_to_pay_search),
263+ }
264
265=== renamed file 'account_banking_payment/model/payment_order_create.py' => 'account_banking_payment_export/model/payment_order_create.py'
266--- account_banking_payment/model/payment_order_create.py 2013-12-05 09:18:43 +0000
267+++ account_banking_payment_export/model/payment_order_create.py 2014-02-16 13:21:01 +0000
268@@ -34,7 +34,7 @@
269 self, cr, uid, payment_order, domain, context=None):
270 if payment_order.payment_order_type == 'payment':
271 domain += [
272- ('account_id.type', '=', 'payable'),
273+ ('account_id.type', 'in', ('payable', 'receivable')),
274 ('amount_to_pay', '>', 0)
275 ]
276 return True
277
278=== removed file 'account_banking_payment_export/model/payment_order_create.py'
279--- account_banking_payment_export/model/payment_order_create.py 2013-09-12 07:06:09 +0000
280+++ account_banking_payment_export/model/payment_order_create.py 1970-01-01 00:00:00 +0000
281@@ -1,58 +0,0 @@
282-# -*- coding: utf-8 -*-
283-##############################################################################
284-#
285-# Copyright (C) 2013 ACSONE SA/NV (<http://acsone.eu>);.
286-#
287-# All other contributions are (C) by their respective contributors
288-#
289-# All Rights Reserved
290-#
291-# This program is free software: you can redistribute it and/or modify
292-# it under the terms of the GNU Affero General Public License as
293-# published by the Free Software Foundation, either version 3 of the
294-# License, or (at your option) any later version.
295-#
296-# This program is distributed in the hope that it will be useful,
297-# but WITHOUT ANY WARRANTY; without even the implied warranty of
298-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
299-# GNU Affero General Public License for more details.
300-#
301-# You should have received a copy of the GNU Affero General Public License
302-# along with this program. If not, see <http://www.gnu.org/licenses/>.
303-#
304-##############################################################################
305-
306-from openerp.osv import orm
307-
308-
309-class payment_order_create(orm.TransientModel):
310- _inherit = 'payment.order.create'
311-
312- def create_payment(self, cr, uid, ids, context=None):
313- '''This method adapts the core create_payment()
314- to pass the payment mode to line2bank() through the context,
315- so it is in turn propagated to suitable_bank_types().
316-
317- This is necessary because the core does not propagate the payment mode to line2bank: t = None in
318- http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/account_payment/wizard/account_payment_order.py#L72
319-
320- Hack idea courtesy Stefan Rijnhart.
321- '''
322- if context is None:
323- context = {}
324- order_obj = self.pool.get('payment.order')
325- payment = order_obj.browse(cr, uid, context['active_id'], context=context)
326- context['_fix_payment_mode_id'] = payment.mode.id
327- return super(payment_order_create, self).create_payment(cr, uid, ids, context=context)
328-
329-
330-class account_move_line(orm.Model):
331- _inherit = 'account.move.line'
332-
333- def line2bank(self, cr, uid, ids, payment_mode_id=None, context=None):
334- '''Obtain payment_type from context, see create_payment above'''
335- if context is None:
336- context = {}
337- payment_mode_id = payment_mode_id or context.get('_fix_payment_mode_id')
338- return super(account_move_line, self).line2bank(cr, uid, ids, payment_mode_id, context=context)
339-
340
341=== modified file 'account_banking_sepa_credit_transfer/__openerp__.py'
342--- account_banking_sepa_credit_transfer/__openerp__.py 2013-11-21 23:41:32 +0000
343+++ account_banking_sepa_credit_transfer/__openerp__.py 2014-02-16 13:21:01 +0000
344@@ -36,6 +36,7 @@
345 'data/payment_type_sepa_sct.xml',
346 'security/ir.model.access.csv',
347 ],
348+ 'demo': ['sepa_credit_transfer_demo.xml'],
349 'description': '''
350 Module to export payment orders in SEPA XML file format.
351
352
353=== added file 'account_banking_sepa_credit_transfer/sepa_credit_transfer_demo.xml'
354--- account_banking_sepa_credit_transfer/sepa_credit_transfer_demo.xml 1970-01-01 00:00:00 +0000
355+++ account_banking_sepa_credit_transfer/sepa_credit_transfer_demo.xml 2014-02-16 13:21:01 +0000
356@@ -0,0 +1,15 @@
357+<?xml version="1.0" encoding="utf-8"?>
358+
359+<openerp>
360+<data noupdate="1">
361+
362+<record id="sepa_credit_transfer_mode" model="payment.mode">
363+ <field name="name">SEPA Credit Transfer La Banque Postale</field>
364+ <field name="journal" ref="account.bank_journal"/>
365+ <field name="bank_id" ref="account_banking_payment_export.main_company_iban"/>
366+ <field name="company_id" ref="base.main_company"/>
367+ <field name="type" ref="export_sepa_sct_001_001_03"/>
368+</record>
369+
370+</data>
371+</openerp>
372
373=== modified file 'account_banking_sepa_direct_debit/__openerp__.py'
374--- account_banking_sepa_direct_debit/__openerp__.py 2013-12-15 23:46:50 +0000
375+++ account_banking_sepa_direct_debit/__openerp__.py 2014-02-16 13:21:01 +0000
376@@ -44,6 +44,7 @@
377 'data/mandate_reference_sequence.xml',
378 'security/ir.model.access.csv',
379 ],
380+ 'demo': ['sepa_direct_debit_demo.xml'],
381 'description': '''
382 Module to export direct debit payment orders in SEPA XML file format.
383
384
385=== modified file 'account_banking_sepa_direct_debit/data/payment_type_sdd.xml'
386--- account_banking_sepa_direct_debit/data/payment_type_sdd.xml 2013-11-07 11:57:26 +0000
387+++ account_banking_sepa_direct_debit/data/payment_type_sdd.xml 2014-02-16 13:21:01 +0000
388@@ -1,9 +1,8 @@
389 <?xml version="1.0" encoding="utf-8"?>
390 <openerp>
391-<data noupdate="0"> <!-- TODO : put to 1 when dev of the module is finished -->
392-
393-
394-<!-- TODO In the suitable_bank_types field, we should add l10n_fr_rib via a small stupid module -->
395+<data noupdate="1">
396+
397+
398 <record id="export_sdd_008_001_02" model="payment.mode.type">
399 <field name="name">SEPA Direct Debit v02 (recommended)</field>
400 <field name="code">pain.008.001.02</field>
401@@ -32,6 +31,5 @@
402 </record>
403
404
405-
406 </data>
407 </openerp>
408
409=== modified file 'account_banking_sepa_direct_debit/sdd_mandate_view.xml'
410--- account_banking_sepa_direct_debit/sdd_mandate_view.xml 2013-12-15 23:46:50 +0000
411+++ account_banking_sepa_direct_debit/sdd_mandate_view.xml 2014-02-16 13:21:01 +0000
412@@ -97,7 +97,7 @@
413 </record>
414
415 <menuitem id="sdd_mandate_menu"
416- parent="account_banking.menu_finance_banking_settings"
417+ parent="account_payment.menu_main_payment"
418 action="sdd_mandate_action"
419 sequence="20"
420 />
421
422=== added file 'account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml'
423--- account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml 1970-01-01 00:00:00 +0000
424+++ account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml 2014-02-16 13:21:01 +0000
425@@ -0,0 +1,27 @@
426+<?xml version="1.0" encoding="utf-8"?>
427+
428+<openerp>
429+<data noupdate="1">
430+
431+<record id="sepa_direct_debit_mode" model="payment.mode">
432+ <field name="name">SEPA Direct Debit La Banque Postale</field>
433+ <field name="journal" ref="account.bank_journal"/>
434+ <field name="bank_id" ref="account_banking_payment_export.main_company_iban"/>
435+ <field name="company_id" ref="base.main_company"/>
436+ <field name="type" ref="export_sdd_008_001_02"/>
437+</record>
438+
439+<record id="base.main_company" model="res.company">
440+ <field name="sepa_creditor_identifier">FR78ZZZ424242</field>
441+</record>
442+
443+<record id="res_partner_12_mandate" model="sdd.mandate">
444+ <field name="partner_bank_id" ref="account_banking_payment_export.res_partner_12_iban"/>
445+ <field name="type">recurrent</field>
446+ <field name="recurrent_sequence_type">first</field>
447+ <field name="signature_date">2014-02-01</field>
448+ <field name="state">valid</field>
449+</record>
450+
451+</data>
452+</openerp>
453
454=== modified file 'account_banking_tests/__openerp__.py'
455--- account_banking_tests/__openerp__.py 2013-09-26 12:51:39 +0000
456+++ account_banking_tests/__openerp__.py 2014-02-16 13:21:01 +0000
457@@ -37,6 +37,5 @@
458 run the tests manually, you don't even have to install this module,
459 only its dependencies.
460 ''',
461- 'auto_install': False,
462 'installable': True,
463 }
464
465=== modified file 'account_direct_debit/__openerp__.py'
466--- account_direct_debit/__openerp__.py 2013-09-13 09:26:06 +0000
467+++ account_direct_debit/__openerp__.py 2014-02-16 13:21:01 +0000
468@@ -25,10 +25,13 @@
469 'author': ['Therp BV', 'Smile'],
470 'website': 'https://launchpad.net/banking-addons',
471 'category': 'Banking addons',
472- 'depends': ['account_banking_payment'],
473+ 'depends': ['account_banking_payment_export'],
474 'data': [
475 'view/account_payment.xml',
476 'view/account_invoice.xml',
477+ 'view/payment_mode.xml',
478+ 'view/payment_mode_type.xml',
479+ 'view/payment_order_create_view.xml',
480 'workflow/account_invoice.xml',
481 'data/account_payment_term.xml',
482 ],
483
484=== modified file 'account_direct_debit/model/__init__.py'
485--- account_direct_debit/model/__init__.py 2013-05-28 13:37:47 +0000
486+++ account_direct_debit/model/__init__.py 2014-02-16 13:21:01 +0000
487@@ -2,4 +2,6 @@
488 import payment_line
489 import account_move_line
490 import account_invoice
491+import payment_mode_type
492+import payment_mode
493 import payment_order_create
494
495=== modified file 'account_direct_debit/model/account_move_line.py'
496--- account_direct_debit/model/account_move_line.py 2013-11-07 22:22:19 +0000
497+++ account_direct_debit/model/account_move_line.py 2014-02-16 13:21:01 +0000
498@@ -27,7 +27,7 @@
499 _inherit = "account.move.line"
500
501 def amount_to_receive(self, cr, uid, ids, name, arg={}, context=None):
502- """
503+ """
504 Return the amount still to receive regarding all the debit orders
505 (excepting canceled orders).
506 This is the reverse from amount_to_pay() in
507@@ -87,7 +87,7 @@
508 return [('id', '=', '0')]
509 return [('id', 'in', map(lambda x:x[0], res))]
510
511- def line2bank(self, cr, uid, ids, payment_mode_id=None, context=None):
512+ def line2bank(self, cr, uid, ids, payment_mode_id, context=None):
513 '''I have to inherit this function for direct debits to fix the
514 following issue : if the customer invoice has a value for
515 'partner_bank_id', then it will take this partner_bank_id
516@@ -98,8 +98,6 @@
517 if context is None:
518 context = {}
519 pay_mode_obj = self.pool['payment.mode']
520- payment_mode_id = (
521- payment_mode_id or context.get('_fix_payment_mode_id'))
522 if payment_mode_id:
523 pay_mode = pay_mode_obj.browse(
524 cr, uid, payment_mode_id, context=context)
525@@ -116,7 +114,7 @@
526 break
527 return line2bank
528 return super(account_move_line, self).line2bank(
529- cr, uid, ids, payment_mode_id=payment_mode_id, context=context)
530+ cr, uid, ids, payment_mode_id, context=context)
531
532 _columns = {
533 'amount_to_receive': fields.function(
534
535=== modified file 'account_direct_debit/model/account_payment.py'
536--- account_direct_debit/model/account_payment.py 2013-11-20 23:24:56 +0000
537+++ account_direct_debit/model/account_payment.py 2014-02-16 13:21:01 +0000
538@@ -19,3 +19,15 @@
539 return False
540 return super(payment_order, self).test_undo_done(
541 cr, uid, ids, context=context)
542+
543+ _columns = {
544+ 'payment_order_type': fields.selection(
545+ [('payment', 'Payment'),('debit', 'Direct debit')],
546+ 'Payment order type', required=True,
547+ readonly=True, states={'draft': [('readonly', False)]},
548+ ),
549+ }
550+
551+ _defaults = {
552+ 'payment_order_type': 'payment',
553+ }
554
555=== renamed file 'account_banking_payment/model/payment_mode.py' => 'account_direct_debit/model/payment_mode.py'
556=== renamed file 'account_banking_payment/model/payment_mode_type.py' => 'account_direct_debit/model/payment_mode_type.py'
557=== renamed file 'account_banking_payment/view/payment_mode.xml' => 'account_direct_debit/view/payment_mode.xml'
558=== renamed file 'account_banking_payment/view/payment_mode_type.xml' => 'account_direct_debit/view/payment_mode_type.xml'
559=== renamed file 'account_banking_payment/view/payment_order_create_view.xml' => 'account_direct_debit/view/payment_order_create_view.xml'

Subscribers

People subscribed via source and target branches

to status/vote changes: