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
=== added directory 'sale_payment_method_transaction_id'
=== added file 'sale_payment_method_transaction_id/__init__.py'
--- sale_payment_method_transaction_id/__init__.py 1970-01-01 00:00:00 +0000
+++ sale_payment_method_transaction_id/__init__.py 2014-01-29 10:10:32 +0000
@@ -0,0 +1,22 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Guewen Baconnier
5# Copyright 2014 Camptocamp SA
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 . import sale
023
=== added file 'sale_payment_method_transaction_id/__openerp__.py'
--- sale_payment_method_transaction_id/__openerp__.py 1970-01-01 00:00:00 +0000
+++ sale_payment_method_transaction_id/__openerp__.py 2014-01-29 10:10:32 +0000
@@ -0,0 +1,48 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Guewen Baconnier
5# Copyright 2014 Camptocamp SA
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
22{'name' : 'Sale Payment Method - Transaction ID Compatibility',
23 'version' : '1.0',
24 'author' : 'Camptocamp',
25 'maintainer': 'Camptocamp',
26 'license': 'AGPL-3',
27 'category': 'Hidden',
28 'depends' : ['sale_payment_method',
29 'base_transaction_id', # in lp:banking-addons/bank-statement-reconcile-7.0
30 ],
31 'description': """
32Sale Payment Method - Transaction ID Compatibility
33==================================================
34
35Link module between the sale payment method module
36and the module adding a transaction ID field (`base_transaction_id` in the
37`lp:banking-addons/bank-statement-reconcile-7.0` branch).
38
39When a payment is created from a sales order with a transaction ID, the
40move lines are created with the transaction id.
41
42 """,
43 'website': 'http://www.camptocamp.com',
44 'data': [],
45 'tests': [],
46 'installable': True,
47 'auto_install': True,
48}
049
=== added file 'sale_payment_method_transaction_id/sale.py'
--- sale_payment_method_transaction_id/sale.py 1970-01-01 00:00:00 +0000
+++ sale_payment_method_transaction_id/sale.py 2014-01-29 10:10:32 +0000
@@ -0,0 +1,36 @@
1# -*- coding: utf-8 -*-
2##############################################################################
3#
4# Author: Guewen Baconnier
5# Copyright 2014 Camptocamp SA
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
23
24
25class sale_order(orm.Model):
26 _inherit = 'sale.order'
27
28 def _prepare_payment_move_line(self, cr, uid, move_name, sale, journal,
29 period, amount, date, context=None):
30 debit_line, credit_line = super(sale_order, self).\
31 _prepare_payment_move_line(cr, uid, move_name, sale, journal,
32 period, amount, date, context=context)
33 if sale.transaction_id:
34 debit_line['transaction_ref'] = sale.transaction_id
35 credit_line['transaction_ref'] = sale.transaction_id
36 return debit_line, credit_line

Subscribers

People subscribed via source and target branches