Skip to content

Commit

Permalink
Merge pull request #60 from acsone/8.0-add-accout-invoice-merge-payme…
Browse files Browse the repository at this point in the history
…nt-ape

[8.0] Add accout invoice merge payment module
  • Loading branch information
hbrunn committed Jul 15, 2015
2 parents 0e69179 + d7abb21 commit edfe5ee
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ virtualenv:

install:
- git clone https://github.com/OCA/maintainer-quality-tools.git ${HOME}/maintainer-quality-tools
- git clone https://github.com/OCA/bank-payment.git -b ${VERSION} ${HOME}/bank-payment
- export PATH=${HOME}/maintainer-quality-tools/travis:${PATH}
- sudo pip install unidecode
- travis_install_nightly
- pip install anybox.testing.openerp # needed for testing account_invoice_line_sort

Expand Down
35 changes: 35 additions & 0 deletions account_invoice_merge_payment/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License AGPL-3

Account Invoice Merge Payment
=============================

This module was written to extend the functionality of Account Invoice Merge
module to support fields added in Account Payment Partner from OCA/bank-payment

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

* The module is automatically installed when account_invoice_merge and account_payment_partner are installed

Credits
=======

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

* Stéphane Bidoul <stephane.bidoul@acsone.eu>
* Adrien Peiffer <adrien.peiffer@acsone.eu>

Maintainer
----------

.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://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 http://odoo-community.org.
2 changes: 2 additions & 0 deletions account_invoice_merge_payment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import models
39 changes: 39 additions & 0 deletions account_invoice_merge_payment/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of account_invoice_merge_payment,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# account_invoice_merge_payment 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.
#
# account_invoice_merge_payment 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 account_invoice_merge_payment.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': "account_invoice_merge_payment",
'summary': """
Use invoice merge regarding fields on Account Payment Partner""",
'author': "ACSONE SA/NV,Odoo Community Association (OCA)",
'website': "http://acsone.eu",
'category': 'Invoicing & Payments',
'version': '0.1',
'license': 'AGPL-3',
'depends': [
'account_invoice_merge',
'account_payment_partner',
],
'auto_install': True
}
2 changes: 2 additions & 0 deletions account_invoice_merge_payment/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import account_invoice
40 changes: 40 additions & 0 deletions account_invoice_merge_payment/models/account_invoice.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# This file is part of account_invoice_merge_payment,
# an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# account_invoice_merge_payment 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.
#
# account_invoice_merge_payment 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 account_invoice_merge_payment.
# If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################

from openerp import models, api
from openerp.addons.account_invoice_merge.invoice import INVOICE_KEY_COLS


INVOICE_KEY_COLS.append('payment_mode_id')


class AccountInvoice(models.Model):
_inherit = 'account.invoice'

@api.model
def _get_first_invoice_fields(self, invoice):
res = super(AccountInvoice, self)._get_first_invoice_fields(invoice)
res.update({'payment_mode_id': invoice.payment_mode_id.id})
return res

0 comments on commit edfe5ee

Please sign in to comment.