From d55a796dbb304a37f2adceb4666f20f3efcd27ed Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Tue, 19 May 2015 11:21:56 +0200 Subject: [PATCH 1/4] [FIX] account: add constraint to ensure that receivable and payable account are reconciliable + fix l10n_be CoA --- addons/account/account.py | 12 ++++++++++++ addons/l10n_be/account_pcmn_belgium.xml | 6 ++++++ addons/purchase/tests/test_purchase_to_invoice.py | 4 ++-- addons/sale/tests/test_sale_to_invoice.py | 4 ++-- addons/stock_dropshipping/tests/test_invoicing.py | 4 ++-- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index a0afbea6c08..6d6abd9226d 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -87,6 +87,13 @@ class AccountAccount(models.Model): # if res[account.id]: # account.has_unreconciled_entries = True + @api.multi + @api.constrains('internal_type', 'reconcile') + def _check_reconcile(self): + for account in self: + if account.internal_type in ('receivable', 'payable') and account.reconcile == False: + raise ValueError(_('You cannot have a receivable/payable account that is not reconciliable. (account code: %s)') % account.code) + name = fields.Char(required=True, index=True) currency_id = fields.Many2one('res.currency', string='Secondary Currency', help="Forces all moves for this account to have this secondary currency.") @@ -124,6 +131,11 @@ class AccountAccount(models.Model): accounts = self.search(domain + args, limit=limit) return accounts.name_get() + @api.onchange('internal_type') + def onchange_internal_type(self): + if self.internal_type in ('receivable', 'payable'): + self.reconcile = True + @api.multi @api.depends('name', 'code') def name_get(self): diff --git a/addons/l10n_be/account_pcmn_belgium.xml b/addons/l10n_be/account_pcmn_belgium.xml index f5306fd0901..5c87952a488 100644 --- a/addons/l10n_be/account_pcmn_belgium.xml +++ b/addons/l10n_be/account_pcmn_belgium.xml @@ -334,18 +334,21 @@ 404 + Acomptes versés 406 + Créances douteuses 407 + T.V.A Déductible @@ -510,18 +513,21 @@ 444 + Acomptes reçus 446 + Compensations fournisseurs 448 + Dettes fiscales estimées diff --git a/addons/purchase/tests/test_purchase_to_invoice.py b/addons/purchase/tests/test_purchase_to_invoice.py index 9ead5b2c1c1..5c870b92133 100644 --- a/addons/purchase/tests/test_purchase_to_invoice.py +++ b/addons/purchase/tests/test_purchase_to_invoice.py @@ -14,9 +14,9 @@ class TestPurchase(common.TransactionCase): # Useful accounts user_type_id = self.ref('account.data_account_type_expenses') - account_exp_id = self.env['account.account'].create({'code': 'X2020', 'name': 'Purchase - Test Expense Account', 'user_type': user_type_id}) + account_exp_id = self.env['account.account'].create({'code': 'X2020', 'name': 'Purchase - Test Expense Account', 'user_type': user_type_id, 'reconcile': True}) user_type_id = self.ref('account.data_account_type_payable') - account_pay_id = self.env['account.account'].create({'code': 'X1012', 'name': 'Purchase - Test Payable Account', 'user_type': user_type_id}) + account_pay_id = self.env['account.account'].create({'code': 'X1012', 'name': 'Purchase - Test Payable Account', 'user_type': user_type_id, 'reconcile': True}) self.env['product.product'].browse(product_id).product_tmpl_id.write({'property_account_expense': account_exp_id}) diff --git a/addons/sale/tests/test_sale_to_invoice.py b/addons/sale/tests/test_sale_to_invoice.py index 315fb0938ad..17a4f17e949 100644 --- a/addons/sale/tests/test_sale_to_invoice.py +++ b/addons/sale/tests/test_sale_to_invoice.py @@ -47,9 +47,9 @@ class TestSale(TestMail): # Usefull accounts user_type_id = IrModelData.xmlid_to_res_id('account.data_account_type_revenue') - account_rev_id = account_obj.create({'code': 'X2020', 'name': 'Sales - Test Sales Account', 'user_type': user_type_id}) + account_rev_id = account_obj.create({'code': 'X2020', 'name': 'Sales - Test Sales Account', 'user_type': user_type_id, 'reconcile': True}) user_type_id = IrModelData.xmlid_to_res_id('account.data_account_type_receivable') - account_recv_id = account_obj.create({'code': 'X1012', 'name': 'Sales - Test Reicv Account', 'user_type': user_type_id}) + account_recv_id = account_obj.create({'code': 'X1012', 'name': 'Sales - Test Reicv Account', 'user_type': user_type_id, 'reconcile': True}) # Add account to product product_template_id = self.env.ref('sale.advance_product_0').product_tmpl_id diff --git a/addons/stock_dropshipping/tests/test_invoicing.py b/addons/stock_dropshipping/tests/test_invoicing.py index 871d0d9e4b1..dae746056c8 100644 --- a/addons/stock_dropshipping/tests/test_invoicing.py +++ b/addons/stock_dropshipping/tests/test_invoicing.py @@ -31,9 +31,9 @@ class TestCreateInvoice(TransactionCase): self.env['account.journal'].create({'name': 'Purchase Journal - Test', 'code': 'DSTPJ', 'type': 'purchase', 'company_id': self.env.ref('base.main_company').id}) user_type_id = self.env.ref('account.data_account_type_payable') - account_pay_id = self.env['account.account'].create({'code': 'X1012', 'name': 'Purchase - Test Payable Account', 'user_type': user_type_id.id}) + account_pay_id = self.env['account.account'].create({'code': 'X1012', 'name': 'Purchase - Test Payable Account', 'user_type': user_type_id.id, 'reconcile': True}) user_type_id = self.env.ref('account.data_account_type_expenses') - account_exp_id = self.env['account.account'].create({'code': 'X1013', 'name': 'Purchase - Test Expense Account', 'user_type': user_type_id.id}) + account_exp_id = self.env['account.account'].create({'code': 'X1013', 'name': 'Purchase - Test Expense Account', 'user_type': user_type_id.id, 'reconcile': True}) self.customer.write({'property_account_payable': account_pay_id.id}) From 4f03ec98cc89987653b8d10a3cf00432e9a2b6bb Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Tue, 19 May 2015 15:13:56 +0200 Subject: [PATCH 2/4] [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. +

+
From b30011d447211b99fb003d373bb7cac6437c73a8 Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 20 May 2015 11:24:51 +0200 Subject: [PATCH 3/4] [REM] account_asset_asset: remove concept of parent/childs from object --- addons/account_asset/account_asset.py | 7 ++----- addons/account_asset/account_asset_demo.yml | 1 - addons/account_asset/account_asset_view.xml | 5 +---- addons/account_asset/test/account_asset_demo_test.xml | 1 - 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index 1372e16e4da..7a326a8df7a 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -243,16 +243,14 @@ class account_asset_asset(osv.osv): 'company_id': fields.many2one('res.company', 'Company', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'note': fields.text('Note'), 'category_id': fields.many2one('account.asset.category', 'Asset Category', required=True, change_default=True, readonly=True, states={'draft':[('readonly',False)]}), - 'parent_id': fields.many2one('account.asset.asset', 'Parent Asset', readonly=True, states={'draft':[('readonly',False)]}), - 'child_ids': fields.one2many('account.asset.asset', 'parent_id', 'Children Assets', copy=True), 'purchase_date': fields.date('Purchase Date', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'state': fields.selection([('draft','Draft'),('open','Running'),('close','Close')], 'Status', required=True, copy=False, help="When an asset is created, the status is 'Draft'.\n" \ "If the asset is confirmed, the status goes in 'Running' and the depreciation lines can be posted in the accounting.\n" \ "You can manually close an asset when the depreciation is over. If the last line of depreciation is posted, the asset automatically goes in that status."), 'active': fields.boolean('Active'), - 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True, states={'draft':[('readonly',False)]}), - 'method': fields.selection([('linear','Linear: Computed on basis of Gross Value / Number of Depreciations'),('degressive','Degressive: Computed on basis of Residual Value * Degressive Factor')], 'Computation Method', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose the method to use to compute the amount of depreciation lines.\n"\ + 'partner_id': fields.many2one('res.partner', 'Supplier', readonly=True, states={'draft':[('readonly',False)]}), + 'method': fields.selection([('linear','Linear'),('degressive','Degressive')], 'Computation Method', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose the method to use to compute the amount of depreciation lines.\n"\ " * Linear: Calculated on basis of: Gross Value / Number of Depreciations\n" \ " * Degressive: Calculated on basis of: Residual Value * Degressive Factor"), 'method_number': fields.integer('Number of Depreciations', readonly=True, states={'draft':[('readonly',False)]}, help="The number of depreciations needed to depreciate your asset"), @@ -293,7 +291,6 @@ class account_asset_asset(osv.osv): return True _constraints = [ - (_check_recursion, 'Error ! You cannot create recursive assets.', ['parent_id']), (_check_prorata, 'Prorata temporis can be applied only for time method "number of depreciations".', ['prorata']), ] diff --git a/addons/account_asset/account_asset_demo.yml b/addons/account_asset/account_asset_demo.yml index b5381b1e73c..cdfdfbbbd46 100644 --- a/addons/account_asset/account_asset_demo.yml +++ b/addons/account_asset/account_asset_demo.yml @@ -43,7 +43,6 @@ 'name': 'V6 Engine and 10 inches tires', 'purchase_value': 2800.0, 'category_id': ref('account_asset_category_fixedassets0'), - 'parent_id': ref('account_asset_asset_vehicles0'), } self._update(cr, uid, 'account.asset.asset', 'account_asset', vals, 'account_asset_asset_cab0') vals = { diff --git a/addons/account_asset/account_asset_view.xml b/addons/account_asset/account_asset_view.xml index 901b9372970..d5a9f609329 100644 --- a/addons/account_asset/account_asset_view.xml +++ b/addons/account_asset/account_asset_view.xml @@ -98,7 +98,6 @@ - @@ -179,7 +178,6 @@ account.asset.asset.tree account.asset.asset - child_ids @@ -198,7 +196,6 @@ account.asset.asset.hierarchy account.asset.asset - child_ids @@ -277,7 +274,7 @@ Asset Hierarchy account.asset.asset tree - [('parent_id','=',False)] + [] diff --git a/addons/account_asset/test/account_asset_demo_test.xml b/addons/account_asset/test/account_asset_demo_test.xml index ff968e904e2..4fbfd8e4a44 100644 --- a/addons/account_asset/test/account_asset_demo_test.xml +++ b/addons/account_asset/test/account_asset_demo_test.xml @@ -54,7 +54,6 @@ V6 Engine and 10 inches tires - From 73a3bea15ee2dfe6e7453930ba803ffff40ef78b Mon Sep 17 00:00:00 2001 From: Cedric Snauwaert Date: Wed, 20 May 2015 14:44:51 +0200 Subject: [PATCH 4/4] [FIX] account: fix transfer_account in settings + create sale/purchase tax template for l10n_generic_coa --- addons/account/res_config.py | 10 ++++++++-- addons/account/tests/test_search.py | 3 +++ addons/account/views/res_config_view.xml | 8 ++++++-- .../data/configurable_account_chart.xml | 19 +++++++++++++++++++ addons/sale/test/cancel_order.yml | 2 +- 5 files changed, 37 insertions(+), 5 deletions(-) diff --git a/addons/account/res_config.py b/addons/account/res_config.py index 6d539551744..8c229f21523 100644 --- a/addons/account/res_config.py +++ b/addons/account/res_config.py @@ -53,6 +53,7 @@ class AccountConfigSettings(models.TransientModel): sale_tax_rate = fields.Float(string='Sales tax (%)') purchase_tax_rate = fields.Float(string='Purchase tax (%)') bank_account_code_char = fields.Char(string='Bank Accounts Code', related='company_id.bank_account_code_char', help='Define the code for the bank account') + template_transfer_account_id = fields.Many2one('account.account.template', help="Intermediary account used when moving money from a liquidity account to another") transfer_account_id = fields.Many2one('account.account', related='company_id.transfer_account_id', domain=lambda self: [('reconcile', '=', True), ('user_type.id', '=', self.env.ref('account.data_account_type_current_assets').id)], @@ -212,7 +213,7 @@ class AccountConfigSettings(models.TransientModel): if self.chart_template_id.code_digits: self.code_digits = self.chart_template_id.code_digits if self.chart_template_id.transfer_account_id: - self.transfer_account_id = self.chart_template_id.transfer_account_id.id + self.template_transfer_account_id = self.chart_template_id.transfer_account_id.id if self.chart_template_id.bank_account_code_char: self.bank_account_code_char = self.chart_template_id.bank_account_code_char return {} @@ -246,6 +247,11 @@ class AccountConfigSettings(models.TransientModel): 'view_mode': 'form', } + @api.multi + def set_transfer_account(self): + if self.transfer_account_id and self.transfer_account_id != self.company_id.transfer_account_id: + self.company_id.write({'transfer_account_id': self.transfer_account_id.id}) + @api.multi def set_product_taxes(self): """ Set the product taxes if they have changed """ @@ -264,7 +270,7 @@ class AccountConfigSettings(models.TransientModel): wizard = self.env['wizard.multi.charts.accounts'].create({ 'company_id': self.company_id.id, 'chart_template_id': self.chart_template_id.id, - 'transfer_account_id': self.transfer_account_id.id, + 'transfer_account_id': self.template_transfer_account_id.id, 'code_digits': self.code_digits or 6, 'sale_tax': self.sale_tax.id, 'purchase_tax': self.purchase_tax.id, diff --git a/addons/account/tests/test_search.py b/addons/account/tests/test_search.py index bea786cf521..7a8ceaef362 100644 --- a/addons/account/tests/test_search.py +++ b/addons/account/tests/test_search.py @@ -15,18 +15,21 @@ class TestSearch(AccountTestUsers): name="Tax Received", code="X121", user_type=ac_ids.id, + reconcile=True, )).id, "X121 Tax Received" self.apurchase = self.account_model.create(dict( name="Purchased Stocks", code="X1101", user_type=ac_ids.id, + reconcile=True, )).id, "X1101 Purchased Stocks" self.asale = self.account_model.create(dict( name="Product Sales", code="XX200", user_type=ac_ids.id, + reconcile=True, )).id, "XX200 Product Sales" self.all_ids = [self.atax[0], self.apurchase[0], self.asale[0]] diff --git a/addons/account/views/res_config_view.xml b/addons/account/views/res_config_view.xml index 9361df9530f..113c605fcbb 100644 --- a/addons/account/views/res_config_view.xml +++ b/addons/account/views/res_config_view.xml @@ -83,6 +83,10 @@ @@ -231,9 +235,9 @@ class="oe_inline oe_link"/> -
+