Merge lp:~camptocamp/e-commerce-addons/7.0-sale_payment_method-base_transaction_id into lp:~extra-addons-commiter/e-commerce-addons/7.0

Proposed by Guewen Baconnier @ Camptocamp
Status: Rejected
Rejected by: Guewen Baconnier @ Camptocamp
Proposed branch: lp:~camptocamp/e-commerce-addons/7.0-sale_payment_method-base_transaction_id
Merge into: lp:~extra-addons-commiter/e-commerce-addons/7.0
Diff against target: 121 lines (+106/-0)
3 files modified
sale_payment_method_transaction_id/__init__.py (+22/-0)
sale_payment_method_transaction_id/__openerp__.py (+48/-0)
sale_payment_method_transaction_id/sale.py (+36/-0)
To merge this branch: bzr merge lp:~camptocamp/e-commerce-addons/7.0-sale_payment_method-base_transaction_id
Reviewer Review Type Date Requested Status
Joël Grand-Guillaume @ camptocamp code review, no tests Approve
Review via email: mp+203694@code.launchpad.net

Commit message

[ADD] sale_payment_method_transaction_id: link module between sale_payment_method and base_transaction_id

Description of the change

In my pursuit to streamline the usage of transaction ids (from lp:banking-addons/bank-statement-reconcile-7.0) throughout all the chain from a sales order to the reconciliation of invoices, payment and bank statements (see also my other MP [0], I propose this new link module to integrate the sale_payment_module with base_transaction_id.

This module is automatically installed when both modules are installed and it does a simple thing: when a sales order has a transaction id, it is copied to the payment move lines. This will later allow to reconcile the entries with the lines generated by the bank statement.

[0] https://code.launchpad.net/~camptocamp/banking-addons/7.0-bank-statement-reconcile-transaction_id-imp/+merge/202806
https://code.launchpad.net/~camptocamp/banking-addons/7.0-bank-statement-reconcile-account_invoice_reference/+merge/202689
https://code.launchpad.net/~camptocamp/openerp-swiss-localization/7.0-wip-invoice-ref-transaction-id/+merge/203006

To post a comment you must log in.
Revision history for this message
Joël Grand-Guillaume @ camptocamp (jgrandguillaume-c2c) wrote :

LGTM, thanks !

review: Approve (code review, no tests)
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Unmerged revisions

291. By Guewen Baconnier @ Camptocamp

[ADD] sale_payment_method_transaction_id: link module between sale_payment_method and base_transaction_id

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'sale_payment_method_transaction_id'
2=== added file 'sale_payment_method_transaction_id/__init__.py'
3--- sale_payment_method_transaction_id/__init__.py 1970-01-01 00:00:00 +0000
4+++ sale_payment_method_transaction_id/__init__.py 2014-01-29 10:10:32 +0000
5@@ -0,0 +1,22 @@
6+# -*- coding: utf-8 -*-
7+##############################################################################
8+#
9+# Author: Guewen Baconnier
10+# Copyright 2014 Camptocamp SA
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU Affero General Public License as
14+# published by the Free Software Foundation, either version 3 of the
15+# License, or (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU Affero General Public License for more details.
21+#
22+# You should have received a copy of the GNU Affero General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+#
25+##############################################################################
26+
27+from . import sale
28
29=== added file 'sale_payment_method_transaction_id/__openerp__.py'
30--- sale_payment_method_transaction_id/__openerp__.py 1970-01-01 00:00:00 +0000
31+++ sale_payment_method_transaction_id/__openerp__.py 2014-01-29 10:10:32 +0000
32@@ -0,0 +1,48 @@
33+# -*- coding: utf-8 -*-
34+##############################################################################
35+#
36+# Author: Guewen Baconnier
37+# Copyright 2014 Camptocamp SA
38+#
39+# This program is free software: you can redistribute it and/or modify
40+# it under the terms of the GNU Affero General Public License as
41+# published by the Free Software Foundation, either version 3 of the
42+# License, or (at your option) any later version.
43+#
44+# This program is distributed in the hope that it will be useful,
45+# but WITHOUT ANY WARRANTY; without even the implied warranty of
46+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
47+# GNU Affero General Public License for more details.
48+#
49+# You should have received a copy of the GNU Affero General Public License
50+# along with this program. If not, see <http://www.gnu.org/licenses/>.
51+#
52+##############################################################################
53+
54+{'name' : 'Sale Payment Method - Transaction ID Compatibility',
55+ 'version' : '1.0',
56+ 'author' : 'Camptocamp',
57+ 'maintainer': 'Camptocamp',
58+ 'license': 'AGPL-3',
59+ 'category': 'Hidden',
60+ 'depends' : ['sale_payment_method',
61+ 'base_transaction_id', # in lp:banking-addons/bank-statement-reconcile-7.0
62+ ],
63+ 'description': """
64+Sale Payment Method - Transaction ID Compatibility
65+==================================================
66+
67+Link module between the sale payment method module
68+and the module adding a transaction ID field (`base_transaction_id` in the
69+`lp:banking-addons/bank-statement-reconcile-7.0` branch).
70+
71+When a payment is created from a sales order with a transaction ID, the
72+move lines are created with the transaction id.
73+
74+ """,
75+ 'website': 'http://www.camptocamp.com',
76+ 'data': [],
77+ 'tests': [],
78+ 'installable': True,
79+ 'auto_install': True,
80+}
81
82=== added file 'sale_payment_method_transaction_id/sale.py'
83--- sale_payment_method_transaction_id/sale.py 1970-01-01 00:00:00 +0000
84+++ sale_payment_method_transaction_id/sale.py 2014-01-29 10:10:32 +0000
85@@ -0,0 +1,36 @@
86+# -*- coding: utf-8 -*-
87+##############################################################################
88+#
89+# Author: Guewen Baconnier
90+# Copyright 2014 Camptocamp SA
91+#
92+# This program is free software: you can redistribute it and/or modify
93+# it under the terms of the GNU Affero General Public License as
94+# published by the Free Software Foundation, either version 3 of the
95+# License, or (at your option) any later version.
96+#
97+# This program is distributed in the hope that it will be useful,
98+# but WITHOUT ANY WARRANTY; without even the implied warranty of
99+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
100+# GNU Affero General Public License for more details.
101+#
102+# You should have received a copy of the GNU Affero General Public License
103+# along with this program. If not, see <http://www.gnu.org/licenses/>.
104+#
105+##############################################################################
106+
107+from openerp.osv import orm
108+
109+
110+class sale_order(orm.Model):
111+ _inherit = 'sale.order'
112+
113+ def _prepare_payment_move_line(self, cr, uid, move_name, sale, journal,
114+ period, amount, date, context=None):
115+ debit_line, credit_line = super(sale_order, self).\
116+ _prepare_payment_move_line(cr, uid, move_name, sale, journal,
117+ period, amount, date, context=context)
118+ if sale.transaction_id:
119+ debit_line['transaction_ref'] = sale.transaction_id
120+ credit_line['transaction_ref'] = sale.transaction_id
121+ return debit_line, credit_line

Subscribers

People subscribed via source and target branches