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
=== modified file 'account_banking_pain_base/banking_export_pain.py'
--- account_banking_pain_base/banking_export_pain.py 2014-01-13 12:41:25 +0000
+++ account_banking_pain_base/banking_export_pain.py 2014-02-16 13:21:01 +0000
@@ -295,7 +295,7 @@
295 party_agent_bic = etree.SubElement(295 party_agent_bic = etree.SubElement(
296 party_agent_institution, gen_args.get('bic_xml_tag'))296 party_agent_institution, gen_args.get('bic_xml_tag'))
297 party_agent_bic.text = bic297 party_agent_bic.text = bic
298 except except_orm:298 except orm.except_orm:
299 if order == 'C':299 if order == 'C':
300 if iban[0:2] != gen_args['initiating_party_country_code']:300 if iban[0:2] != gen_args['initiating_party_country_code']:
301 raise orm.except_orm(301 raise orm.except_orm(
302302
=== modified file 'account_banking_payment/__openerp__.py'
--- account_banking_payment/__openerp__.py 2013-11-07 22:22:19 +0000
+++ account_banking_payment/__openerp__.py 2014-02-16 13:21:01 +0000
@@ -37,13 +37,10 @@
37 'data': [37 'data': [
38 'view/account_payment.xml',38 'view/account_payment.xml',
39 'view/banking_transaction_wizard.xml',39 'view/banking_transaction_wizard.xml',
40 'view/payment_mode.xml',
41 'view/payment_mode_type.xml',
42 'view/payment_order_create_view.xml',
43 'workflow/account_payment.xml',40 'workflow/account_payment.xml',
44 ],41 ],
45 'description': '''42 'description': '''
46 This addon adds payment infrastructure to the Banking Addons.43 This addon adds payment reconciliation infrastructure to the Banking Addons.
4744
48 * Extends payments for digital banking:45 * Extends payments for digital banking:
49 + Adapted workflow in payments to reflect banking operations46 + Adapted workflow in payments to reflect banking operations
5047
=== modified file 'account_banking_payment/model/__init__.py'
--- account_banking_payment/model/__init__.py 2013-11-13 20:53:00 +0000
+++ account_banking_payment/model/__init__.py 2014-02-16 13:21:01 +0000
@@ -1,8 +1,5 @@
1import account_payment1import account_payment
2import payment_line2import payment_line
3import payment_mode_type
4import payment_mode
5import payment_order_create
6import banking_import_transaction3import banking_import_transaction
7import banking_transaction_wizard4import banking_transaction_wizard
8import banking_import_line5import banking_import_line
96
=== modified file 'account_banking_payment/model/account_payment.py'
--- account_banking_payment/model/account_payment.py 2013-11-07 22:22:19 +0000
+++ account_banking_payment/model/account_payment.py 2014-02-16 13:21:01 +0000
@@ -104,18 +104,9 @@
104 "execution."104 "execution."
105 )105 )
106 ),106 ),
107 'payment_order_type': fields.selection(
108 [('payment', 'Payment'),('debit', 'Direct debit')],
109 'Payment order type', required=True,
110 readonly=True, states={'draft': [('readonly', False)]},
111 ),
112 'date_sent': fields.date('Send date', readonly=True),107 'date_sent': fields.date('Send date', readonly=True),
113 }108 }
114109
115 _defaults = {
116 'payment_order_type': 'payment',
117 }
118
119 def _write_payment_lines(self, cr, uid, ids, **kwargs):110 def _write_payment_lines(self, cr, uid, ids, **kwargs):
120 '''111 '''
121 ORM method for setting attributes of corresponding payment.line objects.112 ORM method for setting attributes of corresponding payment.line objects.
122113
=== modified file 'account_banking_payment_export/__openerp__.py'
--- account_banking_payment_export/__openerp__.py 2013-09-11 21:04:40 +0000
+++ account_banking_payment_export/__openerp__.py 2014-02-16 13:21:01 +0000
@@ -3,7 +3,8 @@
3#3#
4# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).4# Copyright (C) 2009 EduSense BV (<http://www.edusense.nl>).
5# (C) 2011 - 2013 Therp BV (<http://therp.nl>).5# (C) 2011 - 2013 Therp BV (<http://therp.nl>).
6# 6# (C) 2013 - 2014 ACSONE SA (<http://acsone.eu>).
7#
7# All other contributions are (C) by their respective contributors8# All other contributions are (C) by their respective contributors
8#9#
9# All Rights Reserved10# All Rights Reserved
@@ -52,6 +53,7 @@
52 'data/payment_mode_type.xml',53 'data/payment_mode_type.xml',
53 'security/ir.model.access.csv',54 'security/ir.model.access.csv',
54 ],55 ],
56 'demo': ['demo/banking_demo.xml'],
55 'description': '''57 'description': '''
56 Infrastructure to export payment orders.58 Infrastructure to export payment orders.
5759
@@ -63,7 +65,7 @@
63 * a better implementation of payment_mode.suitable_bank_types() based on payment.mode.type65 * a better implementation of payment_mode.suitable_bank_types() based on payment.mode.type
64 * the "make payment" button launches a wizard depending on the payment.mode.type66 * the "make payment" button launches a wizard depending on the payment.mode.type
65 * a manual payment mode type is provided as an example, with a default "do nothing" wizard67 * a manual payment mode type is provided as an example, with a default "do nothing" wizard
68 * a couple of improvements the the payment order creation wizard
66 ''',69 ''',
67 'auto_install': True,
68 'installable': True,70 'installable': True,
69}71}
7072
=== added directory 'account_banking_payment_export/demo'
=== added file 'account_banking_payment_export/demo/banking_demo.xml'
--- account_banking_payment_export/demo/banking_demo.xml 1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/demo/banking_demo.xml 2014-02-16 13:21:01 +0000
@@ -0,0 +1,43 @@
1<?xml version="1.0" encoding="utf-8"?>
2
3<openerp>
4<data noupdate="1">
5
6<record id="bank_fortuneo" model="res.bank">
7 <field name="name">Fortuneo Banque</field>
8 <field name="bic">FTNOFRP1XXX</field>
9 <field name="street">26 avenue des Champs Elysées</field>
10 <field name="zip">75008</field>
11 <field name="city">Paris</field>
12 <field name="country" ref="base.fr"/>
13</record>
14
15<record id="bank_la_banque_postale" model="res.bank">
16 <field name="name">La Banque Postale</field>
17 <field name="bic">PSSTFRPPXXX</field>
18 <field name="street">115 rue de Sèvres</field>
19 <field name="zip">75007</field>
20 <field name="city">Paris</field>
21 <field name="country" ref="base.fr"/>
22</record>
23
24<record id="main_company_iban" model="res.partner.bank">
25 <field name="acc_number">FR76 4242 4242 4242 4242 4242 424</field>
26 <field name="state">iban</field>
27 <field name="bank" ref="bank_la_banque_postale"/>
28 <field name="partner_id" ref="base.main_partner" />
29 <field name="bank_name">La Banque Postale</field>
30 <field name="bank_bic">PSSTFRPPXXX</field>
31</record>
32
33<record id="res_partner_12_iban" model="res.partner.bank">
34 <field name="acc_number">FR66 1212 1212 1212 1212 1212 121</field>
35 <field name="state">iban</field>
36 <field name="bank" ref="bank_fortuneo"/>
37 <field name="partner_id" ref="base.res_partner_12" />
38 <field name="bank_name">Fortuneo Banque</field>
39 <field name="bank_bic">FTNOFRP1XXX</field>
40</record>
41
42</data>
43</openerp>
044
=== modified file 'account_banking_payment_export/model/__init__.py'
--- account_banking_payment_export/model/__init__.py 2013-09-23 17:21:51 +0000
+++ account_banking_payment_export/model/__init__.py 2014-02-16 13:21:01 +0000
@@ -1,5 +1,6 @@
1from . import account_move_line
1from . import account_payment2from . import account_payment
2from . import bank_payment_manual3from . import bank_payment_manual
3from . import payment_mode4from . import payment_mode
4from . import payment_mode_type5from . import payment_mode_type
5from . import payment_order_create
6\ No newline at end of file6\ No newline at end of file
7from . import payment_order_create
78
=== added file 'account_banking_payment_export/model/account_move_line.py'
--- account_banking_payment_export/model/account_move_line.py 1970-01-01 00:00:00 +0000
+++ account_banking_payment_export/model/account_move_line.py 2014-02-16 13:21:01 +0000
@@ -0,0 +1,98 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2004-2014 OpenERP S.A. (http://www.openerp.com/)
5# (C) 2014 Akretion (http://www.akretion.com/)
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as
9# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22from openerp.osv import orm, fields
23from operator import itemgetter
24
25
26# All the code below aims at fixing one small issue in _to_pay_search()
27# But _to_pay_search() is the search function of the field 'amount_to_pay'
28# which is a field.function and these functions are not inheritable in OpenERP.
29# So we have to inherit the field 'amount_to_pay' and duplicate the related
30# functions
31# If the patch that I proposed in this bug report
32# https://bugs.launchpad.net/openobject-addons/+bug/1275478
33# is integrated in addons/account_payment, then we will be able to remove this
34# file. -- Alexis de Lattre
35class account_move_line(orm.Model):
36 _inherit = 'account.move.line'
37
38 def amount_to_pay(self, cr, uid, ids, name, arg=None, context=None):
39 """ Return the amount still to pay regarding all the payemnt orders
40 (excepting cancelled orders)"""
41 if not ids:
42 return {}
43 cr.execute("""SELECT ml.id,
44 CASE WHEN ml.amount_currency < 0
45 THEN - ml.amount_currency
46 ELSE ml.credit
47 END -
48 (SELECT coalesce(sum(amount_currency),0)
49 FROM payment_line pl
50 INNER JOIN payment_order po
51 ON (pl.order_id = po.id)
52 WHERE move_line_id = ml.id
53 AND po.state != 'cancel') AS amount
54 FROM account_move_line ml
55 WHERE id IN %s""", (tuple(ids),))
56 r = dict(cr.fetchall())
57 return r
58
59 def _to_pay_search(self, cr, uid, obj, name, args, context=None):
60 if not args:
61 return []
62 line_obj = self.pool.get('account.move.line')
63 query = line_obj._query_get(cr, uid, context={})
64 where = ' and '.join(map(lambda x: '''(SELECT
65 CASE WHEN l.amount_currency < 0
66 THEN - l.amount_currency
67 ELSE l.credit
68 END - coalesce(sum(pl.amount_currency), 0)
69 FROM payment_line pl
70 INNER JOIN payment_order po ON (pl.order_id = po.id)
71 WHERE move_line_id = l.id
72 AND po.state != 'cancel'
73 ) %(operator)s %%s ''' % {'operator': x[1]}, args))
74 sql_args = tuple(map(itemgetter(2), args))
75
76 cr.execute(('''SELECT id
77 FROM account_move_line l
78 WHERE account_id IN (select id
79 FROM account_account
80 WHERE type in %s AND active)
81 AND reconcile_id IS null
82 AND credit > 0
83 AND ''' + where + ' and ' + query),
84 (('payable', 'receivable'),)+sql_args )
85 # The patch we have compared to the original function in
86 # addons/account_payment is just above :
87 # original code : type = 'payable'
88 # fixed code : type in ('payable', 'receivable')
89
90 res = cr.fetchall()
91 if not res:
92 return [('id', '=', '0')]
93 return [('id', 'in', map(lambda x:x[0], res))]
94
95 _columns = {
96 'amount_to_pay': fields.function(amount_to_pay,
97 type='float', string='Amount to pay', fnct_search=_to_pay_search),
98 }
099
=== renamed file 'account_banking_payment/model/payment_order_create.py' => 'account_banking_payment_export/model/payment_order_create.py'
--- account_banking_payment/model/payment_order_create.py 2013-12-05 09:18:43 +0000
+++ account_banking_payment_export/model/payment_order_create.py 2014-02-16 13:21:01 +0000
@@ -34,7 +34,7 @@
34 self, cr, uid, payment_order, domain, context=None):34 self, cr, uid, payment_order, domain, context=None):
35 if payment_order.payment_order_type == 'payment':35 if payment_order.payment_order_type == 'payment':
36 domain += [36 domain += [
37 ('account_id.type', '=', 'payable'),37 ('account_id.type', 'in', ('payable', 'receivable')),
38 ('amount_to_pay', '>', 0)38 ('amount_to_pay', '>', 0)
39 ]39 ]
40 return True40 return True
4141
=== removed file 'account_banking_payment_export/model/payment_order_create.py'
--- account_banking_payment_export/model/payment_order_create.py 2013-09-12 07:06:09 +0000
+++ account_banking_payment_export/model/payment_order_create.py 1970-01-01 00:00:00 +0000
@@ -1,58 +0,0 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Copyright (C) 2013 ACSONE SA/NV (<http://acsone.eu>);.
5#
6# All other contributions are (C) by their respective contributors
7#
8# All Rights Reserved
9#
10# This program is free software: you can redistribute it and/or modify
11# it under the terms of the GNU Affero General Public License as
12# published by the Free Software Foundation, either version 3 of the
13# License, or (at your option) any later version.
14#
15# This program is distributed in the hope that it will be useful,
16# but WITHOUT ANY WARRANTY; without even the implied warranty of
17# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18# GNU Affero General Public License for more details.
19#
20# You should have received a copy of the GNU Affero General Public License
21# along with this program. If not, see <http://www.gnu.org/licenses/>.
22#
23##############################################################################
24
25from openerp.osv import orm
26
27
28class payment_order_create(orm.TransientModel):
29 _inherit = 'payment.order.create'
30
31 def create_payment(self, cr, uid, ids, context=None):
32 '''This method adapts the core create_payment()
33 to pass the payment mode to line2bank() through the context,
34 so it is in turn propagated to suitable_bank_types().
35
36 This is necessary because the core does not propagate the payment mode to line2bank: t = None in
37 http://bazaar.launchpad.net/~openerp/openobject-addons/7.0/view/head:/account_payment/wizard/account_payment_order.py#L72
38
39 Hack idea courtesy Stefan Rijnhart.
40 '''
41 if context is None:
42 context = {}
43 order_obj = self.pool.get('payment.order')
44 payment = order_obj.browse(cr, uid, context['active_id'], context=context)
45 context['_fix_payment_mode_id'] = payment.mode.id
46 return super(payment_order_create, self).create_payment(cr, uid, ids, context=context)
47
48
49class account_move_line(orm.Model):
50 _inherit = 'account.move.line'
51
52 def line2bank(self, cr, uid, ids, payment_mode_id=None, context=None):
53 '''Obtain payment_type from context, see create_payment above'''
54 if context is None:
55 context = {}
56 payment_mode_id = payment_mode_id or context.get('_fix_payment_mode_id')
57 return super(account_move_line, self).line2bank(cr, uid, ids, payment_mode_id, context=context)
58
590
=== modified file 'account_banking_sepa_credit_transfer/__openerp__.py'
--- account_banking_sepa_credit_transfer/__openerp__.py 2013-11-21 23:41:32 +0000
+++ account_banking_sepa_credit_transfer/__openerp__.py 2014-02-16 13:21:01 +0000
@@ -36,6 +36,7 @@
36 'data/payment_type_sepa_sct.xml',36 'data/payment_type_sepa_sct.xml',
37 'security/ir.model.access.csv',37 'security/ir.model.access.csv',
38 ],38 ],
39 'demo': ['sepa_credit_transfer_demo.xml'],
39 'description': '''40 'description': '''
40Module to export payment orders in SEPA XML file format.41Module to export payment orders in SEPA XML file format.
4142
4243
=== added file 'account_banking_sepa_credit_transfer/sepa_credit_transfer_demo.xml'
--- account_banking_sepa_credit_transfer/sepa_credit_transfer_demo.xml 1970-01-01 00:00:00 +0000
+++ account_banking_sepa_credit_transfer/sepa_credit_transfer_demo.xml 2014-02-16 13:21:01 +0000
@@ -0,0 +1,15 @@
1<?xml version="1.0" encoding="utf-8"?>
2
3<openerp>
4<data noupdate="1">
5
6<record id="sepa_credit_transfer_mode" model="payment.mode">
7 <field name="name">SEPA Credit Transfer La Banque Postale</field>
8 <field name="journal" ref="account.bank_journal"/>
9 <field name="bank_id" ref="account_banking_payment_export.main_company_iban"/>
10 <field name="company_id" ref="base.main_company"/>
11 <field name="type" ref="export_sepa_sct_001_001_03"/>
12</record>
13
14</data>
15</openerp>
016
=== modified file 'account_banking_sepa_direct_debit/__openerp__.py'
--- account_banking_sepa_direct_debit/__openerp__.py 2013-12-15 23:46:50 +0000
+++ account_banking_sepa_direct_debit/__openerp__.py 2014-02-16 13:21:01 +0000
@@ -44,6 +44,7 @@
44 'data/mandate_reference_sequence.xml',44 'data/mandate_reference_sequence.xml',
45 'security/ir.model.access.csv',45 'security/ir.model.access.csv',
46 ],46 ],
47 'demo': ['sepa_direct_debit_demo.xml'],
47 'description': '''48 'description': '''
48Module to export direct debit payment orders in SEPA XML file format.49Module to export direct debit payment orders in SEPA XML file format.
4950
5051
=== modified file 'account_banking_sepa_direct_debit/data/payment_type_sdd.xml'
--- account_banking_sepa_direct_debit/data/payment_type_sdd.xml 2013-11-07 11:57:26 +0000
+++ account_banking_sepa_direct_debit/data/payment_type_sdd.xml 2014-02-16 13:21:01 +0000
@@ -1,9 +1,8 @@
1<?xml version="1.0" encoding="utf-8"?>1<?xml version="1.0" encoding="utf-8"?>
2<openerp>2<openerp>
3<data noupdate="0"> <!-- TODO : put to 1 when dev of the module is finished -->3<data noupdate="1">
44
55
6<!-- TODO In the suitable_bank_types field, we should add l10n_fr_rib via a small stupid module -->
7<record id="export_sdd_008_001_02" model="payment.mode.type">6<record id="export_sdd_008_001_02" model="payment.mode.type">
8 <field name="name">SEPA Direct Debit v02 (recommended)</field>7 <field name="name">SEPA Direct Debit v02 (recommended)</field>
9 <field name="code">pain.008.001.02</field>8 <field name="code">pain.008.001.02</field>
@@ -32,6 +31,5 @@
32</record>31</record>
3332
3433
35
36</data>34</data>
37</openerp>35</openerp>
3836
=== modified file 'account_banking_sepa_direct_debit/sdd_mandate_view.xml'
--- account_banking_sepa_direct_debit/sdd_mandate_view.xml 2013-12-15 23:46:50 +0000
+++ account_banking_sepa_direct_debit/sdd_mandate_view.xml 2014-02-16 13:21:01 +0000
@@ -97,7 +97,7 @@
97</record>97</record>
9898
99<menuitem id="sdd_mandate_menu"99<menuitem id="sdd_mandate_menu"
100 parent="account_banking.menu_finance_banking_settings"100 parent="account_payment.menu_main_payment"
101 action="sdd_mandate_action"101 action="sdd_mandate_action"
102 sequence="20"102 sequence="20"
103 />103 />
104104
=== added file 'account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml'
--- account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml 1970-01-01 00:00:00 +0000
+++ account_banking_sepa_direct_debit/sepa_direct_debit_demo.xml 2014-02-16 13:21:01 +0000
@@ -0,0 +1,27 @@
1<?xml version="1.0" encoding="utf-8"?>
2
3<openerp>
4<data noupdate="1">
5
6<record id="sepa_direct_debit_mode" model="payment.mode">
7 <field name="name">SEPA Direct Debit La Banque Postale</field>
8 <field name="journal" ref="account.bank_journal"/>
9 <field name="bank_id" ref="account_banking_payment_export.main_company_iban"/>
10 <field name="company_id" ref="base.main_company"/>
11 <field name="type" ref="export_sdd_008_001_02"/>
12</record>
13
14<record id="base.main_company" model="res.company">
15 <field name="sepa_creditor_identifier">FR78ZZZ424242</field>
16</record>
17
18<record id="res_partner_12_mandate" model="sdd.mandate">
19 <field name="partner_bank_id" ref="account_banking_payment_export.res_partner_12_iban"/>
20 <field name="type">recurrent</field>
21 <field name="recurrent_sequence_type">first</field>
22 <field name="signature_date">2014-02-01</field>
23 <field name="state">valid</field>
24</record>
25
26</data>
27</openerp>
028
=== modified file 'account_banking_tests/__openerp__.py'
--- account_banking_tests/__openerp__.py 2013-09-26 12:51:39 +0000
+++ account_banking_tests/__openerp__.py 2014-02-16 13:21:01 +0000
@@ -37,6 +37,5 @@
37run the tests manually, you don't even have to install this module,37run the tests manually, you don't even have to install this module,
38only its dependencies.38only its dependencies.
39 ''',39 ''',
40 'auto_install': False,
41 'installable': True,40 'installable': True,
42}41}
4342
=== modified file 'account_direct_debit/__openerp__.py'
--- account_direct_debit/__openerp__.py 2013-09-13 09:26:06 +0000
+++ account_direct_debit/__openerp__.py 2014-02-16 13:21:01 +0000
@@ -25,10 +25,13 @@
25 'author': ['Therp BV', 'Smile'],25 'author': ['Therp BV', 'Smile'],
26 'website': 'https://launchpad.net/banking-addons',26 'website': 'https://launchpad.net/banking-addons',
27 'category': 'Banking addons',27 'category': 'Banking addons',
28 'depends': ['account_banking_payment'],28 'depends': ['account_banking_payment_export'],
29 'data': [29 'data': [
30 'view/account_payment.xml',30 'view/account_payment.xml',
31 'view/account_invoice.xml',31 'view/account_invoice.xml',
32 'view/payment_mode.xml',
33 'view/payment_mode_type.xml',
34 'view/payment_order_create_view.xml',
32 'workflow/account_invoice.xml',35 'workflow/account_invoice.xml',
33 'data/account_payment_term.xml',36 'data/account_payment_term.xml',
34 ],37 ],
3538
=== modified file 'account_direct_debit/model/__init__.py'
--- account_direct_debit/model/__init__.py 2013-05-28 13:37:47 +0000
+++ account_direct_debit/model/__init__.py 2014-02-16 13:21:01 +0000
@@ -2,4 +2,6 @@
2import payment_line2import payment_line
3import account_move_line3import account_move_line
4import account_invoice4import account_invoice
5import payment_mode_type
6import payment_mode
5import payment_order_create7import payment_order_create
68
=== modified file 'account_direct_debit/model/account_move_line.py'
--- account_direct_debit/model/account_move_line.py 2013-11-07 22:22:19 +0000
+++ account_direct_debit/model/account_move_line.py 2014-02-16 13:21:01 +0000
@@ -27,7 +27,7 @@
27 _inherit = "account.move.line"27 _inherit = "account.move.line"
2828
29 def amount_to_receive(self, cr, uid, ids, name, arg={}, context=None):29 def amount_to_receive(self, cr, uid, ids, name, arg={}, context=None):
30 """ 30 """
31 Return the amount still to receive regarding all the debit orders31 Return the amount still to receive regarding all the debit orders
32 (excepting canceled orders).32 (excepting canceled orders).
33 This is the reverse from amount_to_pay() in33 This is the reverse from amount_to_pay() in
@@ -87,7 +87,7 @@
87 return [('id', '=', '0')]87 return [('id', '=', '0')]
88 return [('id', 'in', map(lambda x:x[0], res))]88 return [('id', 'in', map(lambda x:x[0], res))]
8989
90 def line2bank(self, cr, uid, ids, payment_mode_id=None, context=None):90 def line2bank(self, cr, uid, ids, payment_mode_id, context=None):
91 '''I have to inherit this function for direct debits to fix the91 '''I have to inherit this function for direct debits to fix the
92 following issue : if the customer invoice has a value for92 following issue : if the customer invoice has a value for
93 'partner_bank_id', then it will take this partner_bank_id93 'partner_bank_id', then it will take this partner_bank_id
@@ -98,8 +98,6 @@
98 if context is None:98 if context is None:
99 context = {}99 context = {}
100 pay_mode_obj = self.pool['payment.mode']100 pay_mode_obj = self.pool['payment.mode']
101 payment_mode_id = (
102 payment_mode_id or context.get('_fix_payment_mode_id'))
103 if payment_mode_id:101 if payment_mode_id:
104 pay_mode = pay_mode_obj.browse(102 pay_mode = pay_mode_obj.browse(
105 cr, uid, payment_mode_id, context=context)103 cr, uid, payment_mode_id, context=context)
@@ -116,7 +114,7 @@
116 break114 break
117 return line2bank115 return line2bank
118 return super(account_move_line, self).line2bank(116 return super(account_move_line, self).line2bank(
119 cr, uid, ids, payment_mode_id=payment_mode_id, context=context)117 cr, uid, ids, payment_mode_id, context=context)
120118
121 _columns = {119 _columns = {
122 'amount_to_receive': fields.function(120 'amount_to_receive': fields.function(
123121
=== modified file 'account_direct_debit/model/account_payment.py'
--- account_direct_debit/model/account_payment.py 2013-11-20 23:24:56 +0000
+++ account_direct_debit/model/account_payment.py 2014-02-16 13:21:01 +0000
@@ -19,3 +19,15 @@
19 return False19 return False
20 return super(payment_order, self).test_undo_done(20 return super(payment_order, self).test_undo_done(
21 cr, uid, ids, context=context)21 cr, uid, ids, context=context)
22
23 _columns = {
24 'payment_order_type': fields.selection(
25 [('payment', 'Payment'),('debit', 'Direct debit')],
26 'Payment order type', required=True,
27 readonly=True, states={'draft': [('readonly', False)]},
28 ),
29 }
30
31 _defaults = {
32 'payment_order_type': 'payment',
33 }
2234
=== renamed file 'account_banking_payment/model/payment_mode.py' => 'account_direct_debit/model/payment_mode.py'
=== renamed file 'account_banking_payment/model/payment_mode_type.py' => 'account_direct_debit/model/payment_mode_type.py'
=== renamed file 'account_banking_payment/view/payment_mode.xml' => 'account_direct_debit/view/payment_mode.xml'
=== renamed file 'account_banking_payment/view/payment_mode_type.xml' => 'account_direct_debit/view/payment_mode_type.xml'
=== 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: