Skip to content

Commit

Permalink
[ADD] Add account_invoice_merge_payment module
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpeiffer committed Jun 8, 2015
1 parent a38bc3a commit 729d06a
Show file tree
Hide file tree
Showing 5 changed files with 122 additions and 0 deletions.
38 changes: 38 additions & 0 deletions account_invoice_merge_payment/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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
============

To install this module, you need to:

* Click on install button

For further information, please visit:

* https://www.odoo.com/forum/help-1

Credits
=======

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

* Stéphane Bidoul <[email protected]>
* Adrien Peiffer <[email protected]>

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
40 changes: 40 additions & 0 deletions account_invoice_merge_payment/__openerp__.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/>.
#
##############################################################################
{
'name': "account_invoice_merge_payment",
'summary': """
Use invoice merge regarding fields on Account Payment Partner""",
'author': "ACSONE SA/NV",
'website': "http://acsone.eu",
'category': 'Invoicing & Payments',
'version': '0.1',
'license': 'AGPL-3',
'depends': [
'account_invoice_merge',
'account_payment_partner',
],
'data': [],
'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 729d06a

Please sign in to comment.