diff --git a/account_invoice_partner_bank_usability/__init__.py b/account_invoice_partner_bank_usability/__init__.py deleted file mode 100644 index 61afd96..0000000 --- a/account_invoice_partner_bank_usability/__init__.py +++ /dev/null @@ -1,23 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account Invoice Partner Bank Usability module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - -from . import account_invoice diff --git a/account_invoice_partner_bank_usability/__openerp__.py b/account_invoice_partner_bank_usability/__openerp__.py deleted file mode 100644 index dcc258c..0000000 --- a/account_invoice_partner_bank_usability/__openerp__.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account Invoice Partner Bank Usability module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - - -{ - 'name': 'Account Invoice Partner Bank Usability', - 'version': '0.1', - 'category': 'Accounting & Finance', - 'license': 'AGPL-3', - 'summary': 'If the company has a single bank account, get the first one on the customer invoice', - 'description': """ -Account Invoice Partner Bank Usability -====================================== - -If the company has a single bank account, we get set this bank account by default on the customer invoice. - -Please contact Alexis de Lattre from Akretion for any help or question about this module. - """, - 'author': 'Akretion', - 'website': 'http://www.akretion.com', - 'depends': ['account'], - 'data': [], - 'images': [], - 'installable': True, - 'active': False, -} diff --git a/account_invoice_partner_bank_usability/account_invoice.py b/account_invoice_partner_bank_usability/account_invoice.py deleted file mode 100644 index 1d84798..0000000 --- a/account_invoice_partner_bank_usability/account_invoice.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Account Invoice Partner Bank Usability module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# 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 . -# -############################################################################## - -from openerp.osv import orm - - -class account_invoice(orm.Model): - _inherit = "account.invoice" - - def invoice_out_get_first_partner_bank(self, cr, uid, context=None): - '''Get the first bank account of your company on customer invoice - if your company only has one bank account''' - if context is None: - context = {} - res_partner_bank_id = False - if context.get('type') == 'out_invoice' or \ - context.get('inv_type') == 'out_invoice': - cur_user = self.pool['res.users'].browse( - cr, uid, uid, context=context) - partner_banks = cur_user.company_id.partner_id.bank_ids - if partner_banks and len(partner_banks) == 1: - res_partner_bank_id = partner_banks[0].id - return res_partner_bank_id - - _defaults = { - 'partner_bank_id': invoice_out_get_first_partner_bank, - }