From 541532230260d2125d410d8e83209767c8cf967e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 8 Jul 2015 11:40:46 +0200 Subject: [PATCH] rename module account_move_usability to account_usability --- account_usability/__init__.py | 3 ++ account_usability/__openerp__.py | 45 ++++++++++++++++++++ account_usability/account.py | 55 ++++++++++++++++++++++++ account_usability/account_view.xml | 68 ++++++++++++++++++++++++++++++ 4 files changed, 171 insertions(+) create mode 100644 account_usability/__init__.py create mode 100644 account_usability/__openerp__.py create mode 100644 account_usability/account.py create mode 100644 account_usability/account_view.xml diff --git a/account_usability/__init__.py b/account_usability/__init__.py new file mode 100644 index 0000000..c6b3892 --- /dev/null +++ b/account_usability/__init__.py @@ -0,0 +1,3 @@ +# -*- encoding: utf-8 -*- + +from . import account diff --git a/account_usability/__openerp__.py b/account_usability/__openerp__.py new file mode 100644 index 0000000..a3c9342 --- /dev/null +++ b/account_usability/__openerp__.py @@ -0,0 +1,45 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account Usability module for Odoo +# Copyright (C) 2015 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 Usability', + 'version': '0.1', + 'category': 'Accounting & Finance', + 'license': 'AGPL-3', + 'summary': 'Small usability enhancements in account module', + 'description': """ +Account Usability +================= + +The usability enhancements include: +* Increase the default limit of 80 lines in account move and account move line view. +* Fast search on *Reconcile Ref* for account move line. + +This module has been written by Alexis de Lattre from Akretion . + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['account'], + 'data': ['account_view.xml'], + 'installable': True, +} diff --git a/account_usability/account.py b/account_usability/account.py new file mode 100644 index 0000000..6fe9492 --- /dev/null +++ b/account_usability/account.py @@ -0,0 +1,55 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Account Usability module for Odoo +# Copyright (C) 2015 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 import models, fields, api + + +class AccountInvoice(models.Model): + _inherit = 'account.invoice' + + origin = fields.Char(track_visibility='onchange') + supplier_invoice_number = fields.Char(track_visibility='onchange') + internal_number = fields.Char(track_visibility='onchange') + reference = fields.Char(track_visibility='onchange') + sent = fields.Boolean(track_visibility='onchange') + date_invoice = fields.Date(track_visibility='onchange') + date_due = fields.Date(track_visibility='onchange') + payment_term = fields.Many2one(track_visibility='onchange') + period_id = fields.Many2one(track_visibility='onchange') + account_id = fields.Many2one(track_visibility='onchange') + journal_id = fields.Many2one(track_visibility='onchange') + partner_bank_id = fields.Many2one(track_visibility='onchange') + fiscal_position = fields.Many2one(track_visibility='onchange') + + +class AccountMoveLine(models.Model): + _inherit = 'account.move.line' + + @api.onchange('credit') + def _credit_onchange(self): + if self.credit and self.debit: + self.debit = 0 + + @api.onchange('debit') + def _debit_onchange(self): + if self.debit and self.credit: + self.credit = 0 diff --git a/account_usability/account_view.xml b/account_usability/account_view.xml new file mode 100644 index 0000000..179833d --- /dev/null +++ b/account_usability/account_view.xml @@ -0,0 +1,68 @@ + + + + + + + + + account_usability.supplier.invoice.form + account.invoice + + + + selection + + + + + + account_usability.invoice.form + account.invoice + + + + selection + + + + + + + + 500 + + + + + 500 + + + + account_usability.account_move_line_search + account.move.line + + + + + + + + + + account_usability.account_move_line_form + account.move.line + + + + + + + + + +