diff --git a/.travis.yml b/.travis.yml index 703c502a39f3..245fd5f1c378 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/account_invoice_merge_payment/README.rst b/account_invoice_merge_payment/README.rst new file mode 100644 index 000000000000..4d4b525a4f82 --- /dev/null +++ b/account_invoice_merge_payment/README.rst @@ -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 +* Adrien Peiffer + +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. diff --git a/account_invoice_merge_payment/__init__.py b/account_invoice_merge_payment/__init__.py new file mode 100644 index 000000000000..a0fdc10fe11b --- /dev/null +++ b/account_invoice_merge_payment/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import models diff --git a/account_invoice_merge_payment/__openerp__.py b/account_invoice_merge_payment/__openerp__.py new file mode 100644 index 000000000000..4f23c5c6bb92 --- /dev/null +++ b/account_invoice_merge_payment/__openerp__.py @@ -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 () +# +# 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 . +# +############################################################################## +{ + '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 +} diff --git a/account_invoice_merge_payment/models/__init__.py b/account_invoice_merge_payment/models/__init__.py new file mode 100644 index 000000000000..1d58beb39799 --- /dev/null +++ b/account_invoice_merge_payment/models/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- +from . import account_invoice diff --git a/account_invoice_merge_payment/models/account_invoice.py b/account_invoice_merge_payment/models/account_invoice.py new file mode 100644 index 000000000000..98be5f23e1a4 --- /dev/null +++ b/account_invoice_merge_payment/models/account_invoice.py @@ -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 () +# +# 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 . +# +############################################################################## + +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