Skip to content

Commit

Permalink
sale_payment_method_transaction_id : migrate to 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Laetitia Gangloff committed Dec 23, 2015
1 parent 1a31422 commit 3f9fddf
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 46 deletions.
1 change: 1 addition & 0 deletions oca_dependencies.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
stock-logistics-workflow
stock-logistics-transport
account-closing
bank-statement-reconcile
server-tools
69 changes: 69 additions & 0 deletions sale_payment_method_transaction_id/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

==================================================
Sale Payment Method - Transaction ID Compatibility
==================================================

Link module between the sale payment method module
and the module adding a transaction ID field (`base_transaction_id` in the
`https://github.com/OCA/bank-statement-reconcile/tree/8.0` branch).

When a payment is created from a sales order with a transaction ID, the
move lines are created with the transaction id.

Installation
============

To install this module, you need to:

* Click on install button

Usage
=====

To use this module, you need to:

* Go to ...

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/167/8.0

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/sale-workflow/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed `feedback
<https://github.com/OCA/sale-workflow/issues/new?body=module:%20sale_payment_method_transaction_id%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Guewen Baconnier <guewen.baconnier@camptocamp.com>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.
21 changes: 1 addition & 20 deletions sale_payment_method_transaction_id/__init__.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,3 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Guewen Baconnier
# Copyright 2014 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

from . import sale
from . import models
19 changes: 3 additions & 16 deletions sale_payment_method_transaction_id/__openerp__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,31 +20,18 @@
##############################################################################

{'name': 'Sale Payment Method - Transaction ID Compatibility',
'version': '1.0',
'version': '8.0.1.0.0',
'author': "Camptocamp,Odoo Community Association (OCA)",
'maintainer': 'Camptocamp',
'license': 'AGPL-3',
'category': 'Hidden',
'depends': ['sale_payment_method',
# base_transaction_id is in
# https://github.com/OCA/bank-statement-reconcile/tree/7.0
# https://github.com/OCA/bank-statement-reconcile/tree/8.0
'base_transaction_id',
],
'description': """
Sale Payment Method - Transaction ID Compatibility
==================================================
Link module between the sale payment method module
and the module adding a transaction ID field (`base_transaction_id` in the
`lp:banking-addons/bank-statement-reconcile-7.0` branch).
When a payment is created from a sales order with a transaction ID, the
move lines are created with the transaction id.
""",
'website': 'http://www.camptocamp.com',
'data': [],
'tests': [],
'installable': False,
'installable': True,
'auto_install': True,
}
3 changes: 3 additions & 0 deletions sale_payment_method_transaction_id/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-

from . import sale
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,19 @@
#
##############################################################################

from openerp.osv import orm
from openerp import api, models


class sale_order(orm.Model):
class SaleOrder(models.Model):
_inherit = 'sale.order'

def _prepare_payment_move_line(self, cr, uid, move_name, sale, journal,
period, amount, date, context=None):
debit_line, credit_line = super(sale_order, self).\
_prepare_payment_move_line(cr, uid, move_name, sale, journal,
period, amount, date, context=context)
if sale.transaction_id:
debit_line['transaction_ref'] = sale.transaction_id
credit_line['transaction_ref'] = sale.transaction_id
@api.multi
def _prepare_payment_move_lines(self, move_name, journal,
period, amount, date):
debit_line, credit_line = super(SaleOrder, self).\
_prepare_payment_move_lines(move_name, journal,
period, amount, date)
if self.transaction_id:
debit_line['transaction_ref'] = self.transaction_id
credit_line['transaction_ref'] = self.transaction_id
return debit_line, credit_line

0 comments on commit 3f9fddf

Please sign in to comment.