From 4f03ec98cc89987653b8d10a3cf00432e9a2b6bb Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Tue, 19 May 2015 15:13:56 +0200 Subject: [PATCH] [FIX] account: various cosmetics fixes --- addons/account/account_bank_statement.py | 6 +- addons/account/account_invoice.py | 2 +- addons/account/account_move.py | 4 +- addons/account/account_payment.py | 8 +- .../static/src/xml/account_payment.xml | 2 +- addons/account/views/account_invoice_view.xml | 8 +- addons/account/views/account_payment_view.xml | 30 ++++- addons/account/views/account_view.xml | 13 +- addons/account/views/res_config_view.xml | 6 +- addons/account_voucher/__init__.py | 1 - addons/account_voucher/__openerp__.py | 1 - addons/account_voucher/account_voucher.py | 4 +- addons/account_voucher/report/__init__.py | 22 ---- .../report/account_voucher_sales_receipt.py | 114 ------------------ .../account_voucher_sales_receipt_view.xml | 78 ------------ .../security/ir.model.access.csv | 4 +- .../voucher_sales_purchase_view.xml | 22 ++-- addons/hr_expense/hr_expense_view.xml | 10 ++ 18 files changed, 76 insertions(+), 259 deletions(-) delete mode 100644 addons/account_voucher/report/__init__.py delete mode 100644 addons/account_voucher/report/account_voucher_sales_receipt.py delete mode 100644 addons/account_voucher/report/account_voucher_sales_receipt_view.xml diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 18d6098ebe2..866ad49c01d 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -21,8 +21,8 @@ class AccountCashboxLine(models.Model): """ Calculates Sub total""" self.subtotal = self.coin_value * self.number - coin_value = fields.Float(string='Unit of Currency', required=True, digits=0) - number = fields.Integer(string='Opening Number of Units', help='Opening Unit Numbers') + coin_value = fields.Float(string='Coin/Bill Value', required=True, digits=0) + number = fields.Integer(string='Number of Coins/Bills', help='Opening Unit Numbers') subtotal = fields.Float(compute='_sub_total', string='Subtotal', digits=0, readonly=True) cashbox_id = fields.Many2one('account.bank.statement.cashbox') @@ -178,7 +178,7 @@ class AccountBankStatement(models.Model): if context.get('cashbox_id'): context['active_id'] = self.id return { - 'name': _('Cashbox Entries'), + 'name': _('Cash Control'), 'view_type': 'form', 'view_mode': 'form', 'res_model': 'account.bank.statement.cashbox', diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index 7fc3ada5a9e..852965f40bc 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -195,7 +195,7 @@ class AccountInvoice(models.Model): move_name = fields.Char(string='Journal Entry', readonly=True, default=False, copy=False, help="Technical field holding the number given to the invoice, automatically set when the invoice is validated then stored to set the same number again if the invoice is cancelled, set to draft and re-validated.") - reference = fields.Char(string='Partner\'s Invoice Reference', + reference = fields.Char(string='Supplier Reference', help="The partner reference of this invoice.") reference_type = fields.Selection('_get_reference_type', string='Payment Reference', required=True, readonly=True, states={'draft': [('readonly', False)]}, diff --git a/addons/account/account_move.py b/addons/account/account_move.py index 47e9db39d74..aef371027a2 100644 --- a/addons/account/account_move.py +++ b/addons/account/account_move.py @@ -293,7 +293,7 @@ class AccountMoveLine(models.Model): counterpart = counterpart[0:2] + ["..."] self.counterpart = ",".join(counterpart) - name = fields.Char(required=True) + name = fields.Char(required=True, string="Label") quantity = fields.Float(digits=(16, 2), help="The optional quantity expressed by this line, eg: number of product sold. The quantity is not a legal requirement but is very useful for some reports.") product_uom_id = fields.Many2one('product.uom', string='Unit of Measure') @@ -333,7 +333,7 @@ class AccountMoveLine(models.Model): help="You can check this box to mark this journal item as a litigation with the associated partner") date_maturity = fields.Date(string='Due date', index=True, required=True, help="This field is used for payable and receivable journal entries. You can put the limit date for the payment of this line.") - date = fields.Date(related='move_id.date', string='Effective date', required=True, index=True, default=fields.Date.context_today, store=True, copy=False) + date = fields.Date(related='move_id.date', string='Date', required=True, index=True, default=fields.Date.context_today, store=True, copy=False) analytic_lines = fields.One2many('account.analytic.line', 'move_id', string='Analytic lines') tax_ids = fields.Many2many('account.tax', string='Taxes', copy=False, readonly=True) tax_line_id = fields.Many2one('account.tax', string='Originator tax', copy=False, readonly=True) diff --git a/addons/account/account_payment.py b/addons/account/account_payment.py index 7200708702c..7201e3a9bce 100644 --- a/addons/account/account_payment.py +++ b/addons/account/account_payment.py @@ -39,8 +39,8 @@ class account_abstract_payment(models.AbstractModel): amount = fields.Monetary(string='Payment Amount', required=True) currency_id = fields.Many2one('res.currency', string='Currency', required=True, default=lambda self: self.env.user.company_id.currency_id) payment_date = fields.Date(string='Payment Date', default=fields.Date.context_today, required=True, copy=False) - communication = fields.Char() - journal_id = fields.Many2one('account.journal', string='Bank Journal', required=True, domain=[('type', 'in', ('bank', 'cash'))]) + communication = fields.Char(string='Memo') + journal_id = fields.Many2one('account.journal', string='Payment Mode', required=True, domain=[('type', 'in', ('bank', 'cash'))]) company_id = fields.Many2one('res.company', related='journal_id.company_id', string='Company', readonly=True) hide_payment_method = fields.Boolean(compute='_compute_hide_payment_method', @@ -214,8 +214,8 @@ class account_payment(models.Model): invoice_ids = fields.Many2many('account.invoice', 'account_invoice_payment_rel', 'payment_id', 'invoice_id', string="Invoices", copy=False, readonly=True) has_invoices = fields.Boolean(compute="_get_has_invoices", help="Technical field used for usablity purposes") - payment_difference = fields.Float(compute='_compute_payment_difference', readonly=True) - payment_difference_handling = fields.Selection([('open', 'Keep Open'), ('reconcile', 'Reconcile Payment Balance')], default='open', string="Payment Difference", copy=False) + payment_difference = fields.Monetary(compute='_compute_payment_difference', readonly=True) + payment_difference_handling = fields.Selection([('open', 'Partial payment'), ('reconcile', 'Mark invoice as fully paid')], default='open', string="Payment Difference", copy=False) writeoff_account = fields.Many2one('account.account', string="Counterpart Account", domain=[('deprecated', '=', False)], copy=False) # FIXME: ondelete='restrict' not working (eg. cancel a bank statement reconciliation with a payment) diff --git a/addons/account/static/src/xml/account_payment.xml b/addons/account/static/src/xml/account_payment.xml index 2f7d4f6e3be..3160f5018b7 100644 --- a/addons/account/static/src/xml/account_payment.xml +++ b/addons/account/static/src/xml/account_payment.xml @@ -22,7 +22,7 @@ - Paid on + Payment on diff --git a/addons/account/views/account_invoice_view.xml b/addons/account/views/account_invoice_view.xml index a2c3ef61854..97b32069818 100644 --- a/addons/account/views/account_invoice_view.xml +++ b/addons/account/views/account_invoice_view.xml @@ -122,9 +122,9 @@ account.invoice + - @@ -186,9 +186,9 @@ account.invoice + - @@ -223,7 +223,7 @@ @@ -364,7 +364,7 @@ diff --git a/addons/account/views/account_payment_view.xml b/addons/account/views/account_payment_view.xml index bb049f9bead..cd14deef6b7 100644 --- a/addons/account/views/account_payment_view.xml +++ b/addons/account/views/account_payment_view.xml @@ -90,7 +90,7 @@ - + @@ -111,6 +111,22 @@ + Payments + account.payment + form + tree,form,graph + {'default_payment_type': 'inbound'} + +

+ Click to register a payment +

+ Payments are used to register liquidity movements (send, collect or transfer money). + You can then process those payments by your own means or by using installed facilities. +

+
+
+ + Payments account.payment form @@ -125,8 +141,9 @@

+ - + account.payment.invoice.form @@ -155,14 +172,17 @@ +
-
@@ -206,7 +226,7 @@
-
diff --git a/addons/account/views/account_view.xml b/addons/account/views/account_view.xml index d77b19da961..fe689729957 100644 --- a/addons/account/views/account_view.xml +++ b/addons/account/views/account_view.xml @@ -333,7 +333,7 @@ - +
@@ -347,7 +347,7 @@ - Cashbox Entries + Cash Control account.bank.statement.cashbox form tree,form @@ -1061,6 +1061,7 @@ + @@ -1068,7 +1069,6 @@ - @@ -1230,13 +1230,13 @@ - - + + @@ -1816,7 +1816,6 @@ - @@ -1891,10 +1890,10 @@ account.financial.report.line + - diff --git a/addons/account/views/res_config_view.xml b/addons/account/views/res_config_view.xml index 04b906fe2eb..9361df9530f 100644 --- a/addons/account/views/res_config_view.xml +++ b/addons/account/views/res_config_view.xml @@ -275,8 +275,10 @@ inline - + + diff --git a/addons/account_voucher/__init__.py b/addons/account_voucher/__init__.py index ecb9dbc9202..74022c65875 100644 --- a/addons/account_voucher/__init__.py +++ b/addons/account_voucher/__init__.py @@ -20,4 +20,3 @@ ############################################################################## import account_voucher -import report diff --git a/addons/account_voucher/__openerp__.py b/addons/account_voucher/__openerp__.py index 52758f6e488..bd7a34b4c58 100644 --- a/addons/account_voucher/__openerp__.py +++ b/addons/account_voucher/__openerp__.py @@ -51,7 +51,6 @@ This module manages: 'security/ir.model.access.csv', 'account_voucher_view.xml', 'voucher_sales_purchase_view.xml', - 'report/account_voucher_sales_receipt_view.xml', 'security/account_voucher_security.xml', 'account_voucher_data.xml', ], diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index e12b265cea4..ae4b436baa1 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -100,7 +100,7 @@ class AccountVoucher(models.Model): \n* The \'Pro-forma\' when voucher is in Pro-forma status,voucher does not have an voucher number. \ \n* The \'Posted\' status is used when user create voucher,a voucher number is generated and voucher entries are created in account \ \n* The \'Cancelled\' status is used when user cancel voucher.') - reference = fields.Char('Supplier Reference', readonly=True, states={'draft': [('readonly', False)]}, + reference = fields.Char('Bill Reference', readonly=True, states={'draft': [('readonly', False)]}, help="The partner reference of this document.", copy=False) amount = fields.Monetary(string='Total', store=True, readonly=True, compute='_compute_total') tax_amount = fields.Monetary(readonly=True, store=True, compute='_compute_total') @@ -111,7 +111,7 @@ class AccountVoucher(models.Model): paid = fields.Boolean(compute='_check_paid', help="The Voucher has been totally paid.") pay_now = fields.Selection([ ('pay_now', 'Pay Directly'), - ('pay_later', 'Pay Later or Group Funds'), + ('pay_later', 'Pay Later'), ], 'Payment', select=True, readonly=True, states={'draft': [('readonly', False)]}, default='pay_now') date_due = fields.Date('Due Date', readonly=True, select=True, states={'draft': [('readonly', False)]}) audit = fields.Boolean('To Review', related="move_id.to_check", help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.') diff --git a/addons/account_voucher/report/__init__.py b/addons/account_voucher/report/__init__.py deleted file mode 100644 index a5e5272517b..00000000000 --- a/addons/account_voucher/report/__init__.py +++ /dev/null @@ -1,22 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2010 Tiny SPRL (). -# -# 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 . -# -############################################################################## - -import account_voucher_sales_receipt diff --git a/addons/account_voucher/report/account_voucher_sales_receipt.py b/addons/account_voucher/report/account_voucher_sales_receipt.py deleted file mode 100644 index d3d43d579f8..00000000000 --- a/addons/account_voucher/report/account_voucher_sales_receipt.py +++ /dev/null @@ -1,114 +0,0 @@ -############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2009 Tiny SPRL (). -# -# 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 tools -from openerp import models, fields - -class sale_receipt_report(models.Model): - _name = "sale.receipt.report" - _description = "Sales Receipt Statistics" - _auto = False - _rec_name = 'date' - date = fields.Date(readonly=True) - currency_id = fields.Many2one('res.currency', string='Currency', readonly=True) - journal_id = fields.Many2one('account.journal', string='Journal', readonly=True) - partner_id = fields.Many2one('res.partner', string='Partner', readonly=True) - company_id = fields.Many2one('res.company', string='Company', readonly=True) - user_id = fields.Many2one('res.users', string='Salesperson', readonly=True) - price_total = fields.Float(string='Total Without Tax', readonly=True) - price_total_tax = fields.Float(string='Total With Tax', readonly=True) - nbr = fields.Integer(string='# of Voucher Lines', readonly=True) - type = fields.Selection([ - ('sale', 'Sale'), - ('purchase', 'Purchase'), - ], readonly=True) - state = fields.Selection([ - ('draft', 'Draft'), - ('proforma', 'Pro-forma'), - ('posted', 'Posted'), - ('cancel', 'Cancelled') - ], string='Voucher Status', readonly=True) - pay_now = fields.Selection([ - ('pay_now', 'Pay Directly'), - ('pay_later', 'Pay Later or Group Funds'), - ], string='Payment', readonly=True) - date_due = fields.Date(string='Due Date', readonly=True) - account_id = fields.Many2one('account.account', string='Account', readonly=True, domain=[('deprecated', '=', False)]) - delay_to_pay = fields.Float(string='Avg. Delay To Pay', readonly=True, group_operator="avg") - due_delay = fields.Float(string='Avg. Due Delay', readonly=True, group_operator="avg") - - _order = 'date desc' - - def init(self, cr): - tools.drop_view_if_exists(cr, 'sale_receipt_report') - cr.execute(""" - create or replace view sale_receipt_report as ( - select min(avl.id) as id, - av.date as date, - av.partner_id as partner_id, - aj.currency_id as currency_id, - av.journal_id as journal_id, - rp.user_id as user_id, - av.company_id as company_id, - count(avl.*) as nbr, - av.voucher_type as type, - av.state, - av.pay_now, - av.date_due as date_due, - av.account_id as account_id, - sum(av.amount-av.tax_amount)/(select count(l.id) from account_voucher_line as l - left join account_voucher as a ON (a.id=l.voucher_id) - where a.id=av.id) as price_total, - sum(av.amount)/(select count(l.id) from account_voucher_line as l - left join account_voucher as a ON (a.id=l.voucher_id) - where a.id=av.id) as price_total_tax, - sum((select extract(epoch from avg(date_trunc('day',aml.date)-date_trunc('day',l.create_date)))/(24*60*60)::decimal(16,2) - from account_move_line as aml - left join account_voucher as a ON (a.move_id=aml.move_id) - left join account_voucher_line as l ON (a.id=l.voucher_id) - where a.id=av.id)) as delay_to_pay, - sum((select extract(epoch from avg(date_trunc('day',a.date_due)-date_trunc('day',a.date)))/(24*60*60)::decimal(16,2) - from account_move_line as aml - left join account_voucher as a ON (a.move_id=aml.move_id) - left join account_voucher_line as l ON (a.id=l.voucher_id) - where a.id=av.id)) as due_delay - from account_voucher_line as avl - left join account_voucher as av on (av.id=avl.voucher_id) - left join res_partner as rp ON (rp.id=av.partner_id) - left join account_journal as aj ON (aj.id=av.journal_id) - where av.voucher_type='sale' and aj.type='sale' - group by - av.date, - av.id, - av.partner_id, - aj.currency_id, - av.journal_id, - rp.user_id, - av.company_id, - av.voucher_type, - av.state, - av.date_due, - av.account_id, - av.tax_amount, - av.amount, - av.tax_amount, - av.pay_now - ) - """) diff --git a/addons/account_voucher/report/account_voucher_sales_receipt_view.xml b/addons/account_voucher/report/account_voucher_sales_receipt_view.xml deleted file mode 100644 index c43175438d4..00000000000 --- a/addons/account_voucher/report/account_voucher_sales_receipt_view.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - sale.receipt.report.pivot - sale.receipt.report - - - - - - - - - - - sale.receipt.report.graph - sale.receipt.report - - - - - - - - - - - sale.receipt.report.search - sale.receipt.report - - - - - - - - - - - - - - - - - - - - - - - - - - - - Sales Receipts Analysis - sale.receipt.report - form - pivot,graph - {'search_default_year':1,'search_default_month':1,'search_default_partner':1, 'search_default_customer':1} - - -

- From this report, you can have an overview of the amount invoiced - to your customer as well as payment delays. The tool search can - also be used to personalise your Invoices reports and so, match - this analysis to your needs. -

-
- -
- - - -
-
diff --git a/addons/account_voucher/security/ir.model.access.csv b/addons/account_voucher/security/ir.model.access.csv index eac7fc13818..c642ccdfcc1 100644 --- a/addons/account_voucher/security/ir.model.access.csv +++ b/addons/account_voucher/security/ir.model.access.csv @@ -2,6 +2,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_account_voucher_manager,account.voucher,model_account_voucher,account.group_account_manager,1,0,0,0 access_account_voucher_line_manager,account.voucher.line,model_account_voucher_line,account.group_account_manager,1,0,0,0 access_account_voucher_invoice,account.voucher invoice,model_account_voucher,account.group_account_invoice,1,1,1,1 -access_account_voucher_line_invoice,account.voucher.line invoice,model_account_voucher_line,account.group_account_invoice,1,1,1,1 -access_sale_receipt_report_manager,account.sale.receipt.report,model_sale_receipt_report,account.group_account_manager,1,1,1,1 -access_sale_receipt_report_user,account.sale.receipt.report,model_sale_receipt_report,account.group_account_user,1,0,0,0 +access_account_voucher_line_invoice,account.voucher.line invoice,model_account_voucher_line,account.group_account_invoice,1,1,1,1 \ No newline at end of file diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index bd2e4720b81..67a83567cdf 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -63,15 +63,15 @@ + - - + @@ -103,8 +103,10 @@ - - + + + + @@ -169,19 +171,19 @@

- + - + - +
- + - + + + diff --git a/addons/hr_expense/hr_expense_view.xml b/addons/hr_expense/hr_expense_view.xml index ce409e3f603..19a8d541cec 100644 --- a/addons/hr_expense/hr_expense_view.xml +++ b/addons/hr_expense/hr_expense_view.xml @@ -230,6 +230,16 @@ tree,form [('state','=','accepted')] + +

+ Click to register new expenses. +

+ Odoo will ensure the whole process is followed; the expense + sheet is validated by manager(s), the employee is reimbursed + from his expenses, some expenses must be re-invoiced to the + customers. +

+