Compare commits

...

2 Commits
10.0 ... 11.0

Author SHA1 Message Date
David Beal
5ba4eadc15 V11 branch 2018-10-16 11:31:50 +02:00
David Beal
79d8f6edc5 INIT v12 2018-10-12 10:33:26 +02:00
4 changed files with 8 additions and 114 deletions

8
README.rst Normal file
View File

@@ -0,0 +1,8 @@
Odoo Usability : 11.0 Branch
============================
Branch unmaintained by Akretion.
Please check these forks:
- https://github.com/camptocamp/odoo-usability

View File

@@ -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 <alexis.delattre@akretion.com>
#
# 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 account_invoice

View File

@@ -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 <alexis.delattre@akretion.com>
#
# 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/>.
#
##############################################################################
{
'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 <alexis.delattre@akretion.com> for any help or question about this module.
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['account'],
'data': [],
'images': [],
'installable': True,
'active': False,
}

View File

@@ -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 <alexis.delattre@akretion.com>
#
# 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 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,
}