From e242773cac11363c1671c8a65de42a95d5cedc15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Thu, 25 Oct 2012 15:38:51 +0200 Subject: [PATCH 01/21] [IMP] For legal reason (forbiden to modify journal entries which belongs to a closed fy or period) : Forbid to modify the code of an account if journal entries have been already posted on this account. This cannot be simply 'configurable' since it can lead to a lack of confidence in OpenERP and this is what we want to change. bzr revid: joel.grandguillaume@camptocamp.com-20121025133851-3mnvsy9ltavys94k --- addons/account/account.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/addons/account/account.py b/addons/account/account.py index c9dd1950347..ebc5aa8af93 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -648,8 +648,19 @@ class account_account(osv.osv): raise osv.except_osv(_('Warning!'), _("You cannot change the type of account from '%s' to '%s' type as it contains journal items!") % (old_type,new_type,)) return True - def write(self, cr, uid, ids, vals, context=None): + # For legal reason (forbiden to modify journal entries which belongs to a closed fy or period), Forbid to modify + # the code of an account if journal entries have been already posted on this account. This cannot be simply + # 'configurable' since it can lead to a lack of confidence in OpenERP and this is what we want to change. + def _check_allow_code_change(self, cr, uid, ids, context=None): + line_obj = self.pool.get('account.move.line') + for account in self.browse(cr, uid, ids, context=context): + account_ids = self.search(cr, uid, [('id', 'child_of', [account.id])]) + if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]): + raise osv.except_osv(_('Warning !'), _("You cannot change the code of account which contains journal items!")) + return True + + def write(self, cr, uid, ids, vals, context=None): if context is None: context = {} if not ids: @@ -669,6 +680,8 @@ class account_account(osv.osv): self._check_moves(cr, uid, ids, "write", context=context) if 'type' in vals.keys(): self._check_allow_type_change(cr, uid, ids, vals['type'], context=context) + if 'code' in vals.keys(): + self._check_allow_code_change(cr, uid, ids, context=context) return super(account_account, self).write(cr, uid, ids, vals, context=context) def unlink(self, cr, uid, ids, context=None): From aef8541bc8e422dce8d718986f00f109c30ebc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Thu, 25 Oct 2012 15:47:02 +0200 Subject: [PATCH 02/21] [IMP] Forbid to change type of account for 'consolidation' and 'view' if there is entries on it or his children. bzr revid: joel.grandguillaume@camptocamp.com-20121025134702-7px784iu3226qc0l --- addons/account/account.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index ebc5aa8af93..33150274bdf 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -633,8 +633,7 @@ class account_account(osv.osv): return True def _check_allow_type_change(self, cr, uid, ids, new_type, context=None): - group1 = ['payable', 'receivable', 'other'] - group2 = ['consolidation','view'] + group_dest = ['consolidation','view'] line_obj = self.pool.get('account.move.line') for account in self.browse(cr, uid, ids, context=context): old_type = account.type @@ -642,12 +641,12 @@ class account_account(osv.osv): if line_obj.search(cr, uid, [('account_id', 'in', account_ids)]): #Check for 'Closed' type if old_type == 'closed' and new_type !='closed': - raise osv.except_osv(_('Warning!'), _("You cannot change the type of account from 'Closed' to any other type which contains journal items!")) - #Check for change From group1 to group2 and vice versa - if (old_type in group1 and new_type in group2) or (old_type in group2 and new_type in group1): - raise osv.except_osv(_('Warning!'), _("You cannot change the type of account from '%s' to '%s' type as it contains journal items!") % (old_type,new_type,)) - return True + raise osv.except_osv(_('Warning !'), _("You cannot change the type of account from 'Closed' to any other type which contains journal items!")) + # Forbid to change an account type for group_dest if move are on it (or his children) + if (new_type in group_dest): + raise osv.except_osv(_('Warning !'), _("You cannot change the type of account for '%s' type as it contains journal items!") % (new_type,)) + return True # For legal reason (forbiden to modify journal entries which belongs to a closed fy or period), Forbid to modify # the code of an account if journal entries have been already posted on this account. This cannot be simply From 8132259454bf6b19b9f740510a21cf087a112dff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Fri, 26 Oct 2012 10:49:58 +0200 Subject: [PATCH 03/21] [IMP] Add a constraints on reconcile object to forbid the reconciliation between different partner [IMP] Add a constraint on account move: you cannot pickup a date that is not in the fiscal year of the concerned period bzr revid: joel.grandguillaume@camptocamp.com-20121026084958-nlcoqlav00l42gwr --- addons/account/account.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/addons/account/account.py b/addons/account/account.py index 33150274bdf..f3ba38fee8d 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1313,6 +1313,14 @@ class account_move(osv.osv): 'company_id': lambda self, cr, uid, c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id, } + def _check_fiscal_year(self, cursor, user, ids): + for move in self.browse(cursor, user, ids): + date_start = move.period_id.fiscalyear_id.date_start + date_stop = move.period_id.fiscalyear_id.date_stop + if move.date < date_start or move.date > date_stop: + return False + return True + def _check_centralisation(self, cursor, user, ids, context=None): for move in self.browse(cursor, user, ids, context=context): if move.journal_id.centralisation: @@ -1328,6 +1336,9 @@ class account_move(osv.osv): (_check_centralisation, 'You cannot create more than one move per period on a centralized journal.', ['journal_id']), + (_check_fiscal_year, + 'You cannot create entries with date not in the fiscal year of the chosen period', + ['line_id','']), ] def post(self, cr, uid, ids, context=None): @@ -1686,7 +1697,25 @@ class account_move_reconcile(osv.osv): _defaults = { 'name': lambda self,cr,uid,ctx=None: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile', context=ctx) or '/', } + + # Look in the line_id and line_partial_ids to ensure the partner is the same or empty + # on all lines + def _check_same_partner(self, cr, uid, ids, context=None): + for reconcile in self.browse(cr, uid, ids, context=context): + if reconcile.line_id: + first_partner = reconcile.line_id[0].partner_id.id + move_lines = reconcile.line_id + elif reconcile.line_partial_ids: + first_partner = reconcile.line_partial_ids[0].partner_id.id + move_lines = reconcile.line_partial_ids + if any([line.partner_id.id != first_partner for line in move_lines]): + return False + return True + _constraints = [ + (_check_same_partner, 'You can only reconcile moves where the partner (we mean ID) is the same or empty on all entries.', ['line_id']), + ] + def reconcile_partial_check(self, cr, uid, ids, type='auto', context=None): total = 0.0 for rec in self.browse(cr, uid, ids, context=context): From eaf53213da2ba6bb0e620d8eadc58e33016e2aaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Fri, 26 Oct 2012 11:12:42 +0200 Subject: [PATCH 04/21] [IMP] Forbid the user to delete any move linked to an invoice. Cancelling invoice still work obviously bzr revid: joel.grandguillaume@camptocamp.com-20121026091242-9fu2a4do0ra50fqu --- addons/account/account.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/addons/account/account.py b/addons/account/account.py index f3ba38fee8d..330e3f2d742 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1485,6 +1485,11 @@ class account_move(osv.osv): raise osv.except_osv(_('User Error!'), _('You cannot delete a posted journal entry "%s".') % \ move['name']) + for line in move.line_id: + if line.invoice: + raise osv.except_osv(_('User Error!'), + _("Move cannot be deleted if linked to an invoice: %s : Move ID:%s.") % \ + (line.invoice.number,move.name)) line_ids = map(lambda x: x.id, move.line_id) context['journal_id'] = move.journal_id.id context['period_id'] = move.period_id.id From 87be45dcd659384b6f63c7dc2e15a2efc5730d13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Fri, 26 Oct 2012 12:51:32 +0200 Subject: [PATCH 05/21] [IMP] For manual entries when multicurrency : a - Validation on the use of the 'Currency' and 'Currency Amount' fields as it is possible to enter one without the other b - Validation to prevent a Credit amount with a positive 'Currency Amount', or a Debit with a negative 'Currency Amount' bzr revid: joel.grandguillaume@camptocamp.com-20121026105132-6x0zh3gc823h3b68 --- addons/account/account_move_line.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 67a55d8f451..ffb9bb3ef0c 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -613,12 +613,27 @@ class account_move_line(osv.osv): return False return True + def _check_currency_and_amount(self, cr, uid, ids, context=None): + for l in self.browse(cr, uid, ids, context=context): + if (l.currency_id and not l.amount_currency) or (not l.currency_id and l.amount_currency): + return False + return True + + def _check_currency_amount(self, cr, uid, ids, context=None): + for l in self.browse(cr, uid, ids, context=context): + if l.amount_currency: + if (l.amount_currency > 0.0 and l.credit > 0.0) or (l.amount_currency < 0.0 and l.debit > 0.0): + return False + return True + _constraints = [ (_check_no_view, 'You cannot create journal items on an account of type view.', ['account_id']), (_check_no_closed, 'You cannot create journal items on closed account.', ['account_id']), (_check_company_id, 'Account and Period must belong to the same company.', ['company_id']), (_check_date, 'The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal.', ['date']), (_check_currency, 'The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal.', ['currency_id']), + (_check_currency_and_amount, "You cannot create journal items with a secondary currency without recording both 'currency' and 'amount currency' field.", ['currency_id','amount_currency']), + (_check_currency_amount, 'The amount expressed in the secondary currency must be positif when journal item are debit and negatif when journal item are credit.', ['amount_currency']), ] #TODO: ONCHANGE_ACCOUNT_ID: set account_tax_id From 72805c8ad407f7d1904233dd03fe8bcf943f4a67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Fri, 26 Oct 2012 13:06:31 +0200 Subject: [PATCH 06/21] [IMP] Add a check on entries that user cannot provide a secondary currency if the same than the company one. bzr revid: joel.grandguillaume@camptocamp.com-20121026110631-vz7vx4ae0axabh14 --- addons/account/account_move_line.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index ffb9bb3ef0c..147fe7f76a4 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -626,6 +626,12 @@ class account_move_line(osv.osv): return False return True + def _check_currency_company(self, cr, uid, ids, context=None): + for l in self.browse(cr, uid, ids, context=context): + if l.currency_id.id == l.company_id.currency_id.id: + return False + return True + _constraints = [ (_check_no_view, 'You cannot create journal items on an account of type view.', ['account_id']), (_check_no_closed, 'You cannot create journal items on closed account.', ['account_id']), @@ -634,6 +640,7 @@ class account_move_line(osv.osv): (_check_currency, 'The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal.', ['currency_id']), (_check_currency_and_amount, "You cannot create journal items with a secondary currency without recording both 'currency' and 'amount currency' field.", ['currency_id','amount_currency']), (_check_currency_amount, 'The amount expressed in the secondary currency must be positif when journal item are debit and negatif when journal item are credit.', ['amount_currency']), + (_check_currency_company, "You can't provide a secondary currency if the same than the company one." , ['currency_id']), ] #TODO: ONCHANGE_ACCOUNT_ID: set account_tax_id From 9527a10ba50520bade31e8be081aa200bf0dcced Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Fri, 26 Oct 2012 13:16:41 +0200 Subject: [PATCH 07/21] [IMP] Forbid to change the journal of a bank statement if you already have a line in it. This is done in the voucher, cause this is the case that break : when voucher is created and you change the journal, it'll result in having entries generated on various journal which is not consistent. bzr revid: joel.grandguillaume@camptocamp.com-20121026111641-a0lg5h1mcyh1tit7 --- addons/account_voucher/account_voucher.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index f25318727df..3e9fe15d3d1 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -1532,7 +1532,17 @@ class account_bank_statement(osv.osv): }) return move_line_obj.write(cr, uid, [x.id for x in v.move_ids], {'statement_id': st_line.statement_id.id}, context=context) - return super(account_bank_statement, self).create_move_from_st_line(cr, uid, st_line.id, company_currency_id, next_number, context=context) + + def write(self, cr, uid, ids, vals, context=None): + # We should not be able to change the journal if we already have + # bank statement line generated in case we use the voucher. This is because + # the import feature will write the current used journal. That lead to crap + # cause we should not be able to do that... A bank statement is by definition linked + # to one journal ! + for bk_st in self.browse(cr, uid, ids, context=context): + if vals.get('journal_id', False) and bk_st.line_ids: + raise osv.except_osv(_('Unable to change journal !'), _('You can not change the journal if you already generated lines !')) + return super(account_bank_statement, self).write(cr, uid, ids, vals, context=context) account_bank_statement() From 6ef3db0a864612cc54be4a4dec2c9247ef5d7157 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Fri, 26 Oct 2012 13:35:02 +0200 Subject: [PATCH 08/21] [FIX] Do not provide a secondary currency when posting entries from bank statment if the same than the company to respect the new constraints. bzr revid: joel.grandguillaume@camptocamp.com-20121026113502-jsxdf5swqfizfcen --- addons/account/account_bank_statement.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 48082451f35..68d1f3279f3 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -311,7 +311,7 @@ class account_bank_statement(osv.osv): 'statement_id': st_line.statement_id.id, 'journal_id': st_line.statement_id.journal_id.id, 'period_id': st_line.statement_id.period_id.id, - 'currency_id': cur_id, + 'currency_id': amount_currency and cur_id, 'amount_currency': amount_currency, 'analytic_account_id': analytic_id, } From 19e1d840c4264f96e99e424260f44a701a7564b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Fri, 26 Oct 2012 14:29:21 +0200 Subject: [PATCH 09/21] [IMP] Add contraint for Payment Order : If a invoice is imported in a payment order, forbid to reset invoice to cancel or draft bzr revid: joel.grandguillaume@camptocamp.com-20121026122921-fdlrothxta992cd3 --- addons/account_payment/account_invoice.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/addons/account_payment/account_invoice.py b/addons/account_payment/account_invoice.py index 7138540fa3b..60085a890c7 100644 --- a/addons/account_payment/account_invoice.py +++ b/addons/account_payment/account_invoice.py @@ -20,12 +20,29 @@ ############################################################################## from datetime import datetime - +from tools.translate import _ from osv import fields, osv class Invoice(osv.osv): _inherit = 'account.invoice' + # Forbid to cancel an invoice if the related move lines have already been + # used in a payment order. The risk is that importing the payment line + # in the bank statement will result in a crash cause no more move will + # be found in the payment line + def action_cancel(self, cr, uid, ids, *args): + payment_line_obj = self.pool.get('payment.line') + invoices = self.browse(cr, uid, ids) + for inv in invoices: + inv_mv_lines = map(lambda x: x.id, inv.move_id.line_id) + pl_line_ids = payment_line_obj.search(cr, uid, [('move_line_id','in',inv_mv_lines)]) + if pl_line_ids: + pay_line = payment_line_obj.browse(cr,uid,pl_line_ids) + payment_order_name = ','.join(map(lambda x: x.order_id.reference, pay_line)) + raise osv.except_osv(_('Error!'), _("You cannot cancel an invoice which has already been imported in a payment order. Remove it from the following payment order : %s."%(payment_order_name))) + result = super(Invoice, self).action_cancel(cr, uid, ids, *args) + return result + def _amount_to_pay(self, cursor, user, ids, name, args, context=None): '''Return the amount still to pay regarding all the payment orders''' if not ids: From 227738dedb586128eac1753795bc85d806ee127d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=ABl=20Grand-Guillaume?= Date: Fri, 26 Oct 2012 15:54:15 +0200 Subject: [PATCH 10/21] [IMP] Forbid to remove the reconcile on opening entries, we introduce a new boolean field to identify the reconciliation made by the closing process from others. bzr revid: joel.grandguillaume@camptocamp.com-20121026135415-k1q0yq5zxngmfm5k --- addons/account/account.py | 31 +++++++++++++------ addons/account/account_move_line.py | 4 ++- .../wizard/account_fiscalyear_close.py | 4 +-- 3 files changed, 27 insertions(+), 12 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 330e3f2d742..2e60c47d758 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1698,23 +1698,36 @@ class account_move_reconcile(osv.osv): 'line_id': fields.one2many('account.move.line', 'reconcile_id', 'Entry Lines'), 'line_partial_ids': fields.one2many('account.move.line', 'reconcile_partial_id', 'Partial Entry lines'), 'create_date': fields.date('Creation date', readonly=True), + 'opening_reconcile': fields.boolean('Opening entries reconciliation', help="Is this reconciliation produced by the opening of a new fiscal year ?."), } _defaults = { 'name': lambda self,cr,uid,ctx=None: self.pool.get('ir.sequence').get(cr, uid, 'account.reconcile', context=ctx) or '/', + 'opening_reconcile': 0, } + # You cannot unlink a reconciliation if it is a opening_reconcile one, + # you should use the generate opening entries wizard for that + def unlink(self, cr, uid, ids, context=None): + for move_rec in self.browse(cr, uid, ids): + if move_rec.opening_reconcile: + raise osv.except_osv(_('Error!'), _('You cannot unreconcile journal items if they has been generated by the \ + opening/closing fiscal year process.')) + return super(account_move_reconcile, self).unlink(cr, uid, ids, context=context) + # Look in the line_id and line_partial_ids to ensure the partner is the same or empty - # on all lines + # on all lines. We allow that only for opening/closing period def _check_same_partner(self, cr, uid, ids, context=None): for reconcile in self.browse(cr, uid, ids, context=context): - if reconcile.line_id: - first_partner = reconcile.line_id[0].partner_id.id - move_lines = reconcile.line_id - elif reconcile.line_partial_ids: - first_partner = reconcile.line_partial_ids[0].partner_id.id - move_lines = reconcile.line_partial_ids - if any([line.partner_id.id != first_partner for line in move_lines]): - return False + move_lines = [] + if not reconcile.opening_reconcile: + if reconcile.line_id: + first_partner = reconcile.line_id[0].partner_id.id + move_lines = reconcile.line_id + elif reconcile.line_partial_ids: + first_partner = reconcile.line_partial_ids[0].partner_id.id + move_lines = reconcile.line_partial_ids + if any([line.partner_id.id != first_partner for line in move_lines]): + return False return True _constraints = [ diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index 147fe7f76a4..ed6b9caf9a8 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -1126,7 +1126,7 @@ class account_move_line(osv.osv): 'has been confirmed.') % res[2]) return res - def _remove_move_reconcile(self, cr, uid, move_ids=None, context=None): + def _remove_move_reconcile(self, cr, uid, move_ids=None, opening_reconcile=False, context=None): # Function remove move rencocile ids related with moves obj_move_line = self.pool.get('account.move.line') obj_move_rec = self.pool.get('account.move.reconcile') @@ -1141,6 +1141,8 @@ class account_move_line(osv.osv): unlink_ids += rec_ids unlink_ids += part_rec_ids if unlink_ids: + if opening_reconcile: + obj_move_rec.write(cr, uid, unlink_ids, {'opening_reconcile':False}) obj_move_rec.unlink(cr, uid, unlink_ids) return True diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py index 196c14d3792..60a2e486948 100644 --- a/addons/account/wizard/account_fiscalyear_close.py +++ b/addons/account/wizard/account_fiscalyear_close.py @@ -60,7 +60,7 @@ class account_fiscalyear_close(osv.osv_memory): cr.execute('select distinct(company_id) from account_move_line where id in %s',(tuple(ids),)) if len(cr.fetchall()) > 1: raise osv.except_osv(_('Warning!'), _('The entries to reconcile should belong to the same company.')) - r_id = self.pool.get('account.move.reconcile').create(cr, uid, {'type': 'auto'}) + r_id = self.pool.get('account.move.reconcile').create(cr, uid, {'type': 'auto', 'opening_reconcile':True}) cr.execute('update account_move_line set reconcile_id = %s where id in %s',(r_id, tuple(ids),)) return r_id @@ -107,7 +107,7 @@ class account_fiscalyear_close(osv.osv_memory): ('journal_id', '=', new_journal.id), ('period_id', '=', period.id)]) if move_ids: move_line_ids = obj_acc_move_line.search(cr, uid, [('move_id', 'in', move_ids)]) - obj_acc_move_line._remove_move_reconcile(cr, uid, move_line_ids, context=context) + obj_acc_move_line._remove_move_reconcile(cr, uid, move_line_ids, opening_reconcile=True, context=context) obj_acc_move_line.unlink(cr, uid, move_line_ids, context=context) obj_acc_move.unlink(cr, uid, move_ids, context=context) From be779f57d08dd1f5bda974fa68150fe65ea8b379 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 29 Oct 2012 16:08:09 +0100 Subject: [PATCH 11/21] [IMP] useability timesheets bzr revid: fp@tinyerp.com-20121029150809-86cieq1flmb45ubl --- addons/hr/res_config.py | 2 +- .../hr_timesheet_sheet/hr_timesheet_sheet.py | 4 ++-- .../hr_timesheet_sheet_view.xml | 23 +++++++++++-------- 3 files changed, 16 insertions(+), 13 deletions(-) diff --git a/addons/hr/res_config.py b/addons/hr/res_config.py index 148499190fd..299c5ca68fe 100644 --- a/addons/hr/res_config.py +++ b/addons/hr/res_config.py @@ -42,7 +42,7 @@ class hr_config_settings(osv.osv_memory): help ="""This installs the module hr_contract."""), 'module_hr_evaluation': fields.boolean('Organize employees periodic evaluation', help ="""This installs the module hr_evaluation."""), - 'module_account_analytic_analysis': fields.boolean('Allow invoicing based on timesheets (will install the sale application)', + 'module_account_analytic_analysis': fields.boolean('Allow invoicing based on timesheets (the sale application will be installed)', help ="""This installs the module account_analytic_analysis, which will install sales management too."""), 'module_hr_payroll': fields.boolean('Manage payroll', help ="""This installs the module hr_payroll."""), diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 9902d82d95b..a9276ba6984 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -79,7 +79,7 @@ class hr_timesheet_sheet(osv.osv): if not new_user_id: raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must assign it to a user.')) if not self._sheet_date(cr, uid, ids, forced_user_id=new_user_id): - raise osv.except_osv(_('Error!'), _('You cannot have 2 timesheets that overlaps!\nYou should use the menu \'My Timesheet\' to avoid this problem.')) + raise osv.except_osv(_('Error!'), _('You cannot have 2 timesheets that overlap!\nYou should use the menu \'My Timesheet\' to avoid this problem.')) if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).product_id: raise osv.except_osv(_('Error!'), _('In order to create a timesheet for this employee, you must link the employee to a product.')) if not self.pool.get('hr.employee').browse(cr, uid, vals['employee_id']).journal_id: @@ -187,7 +187,7 @@ class hr_timesheet_sheet(osv.osv): _constraints = [ - (_sheet_date, 'You cannot have 2 timesheets that overlaps !\nPlease use the menu \'My Current Timesheet\' to avoid this problem.', ['date_from','date_to']), + (_sheet_date, 'You cannot have 2 timesheets that overlap!\nPlease use the menu \'My Current Timesheet\' to avoid this problem.', ['date_from','date_to']), ] def action_set_to_draft(self, cr, uid, ids, *args): diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml index 098853fafac..ee5a329c800 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml @@ -303,18 +303,21 @@ + context="{'search_default_sheet_id': [active_id]}" + id="act_hr_timesheet_sheet_sheet_by_account" + name="Timesheet by Account" + groups="base.group_hr_attendance" + res_model="hr_timesheet_sheet.sheet.account" + src_model="hr_timesheet_sheet.sheet"/> + context="{'search_default_sheet_id': [active_id]}" + id="act_hr_timesheet_sheet_sheet_by_day" + name="Timesheet by Day" + groups="base.group_hr_attendance" + res_model="hr_timesheet_sheet.sheet.day" + src_model="hr_timesheet_sheet.sheet"/> + hr.timesheet.sheet.tree hr_timesheet_sheet.sheet From 57d0ba0b23a68383b036312cdf617b1a41539ec3 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 29 Oct 2012 16:25:57 +0100 Subject: [PATCH 12/21] [IMP] useaiblity views bzr revid: fp@tinyerp.com-20121029152557-tje0jdyl3quglgyx --- .../project/wizard/account_analytic_journal_report_view.xml | 2 +- addons/project/project_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/account/project/wizard/account_analytic_journal_report_view.xml b/addons/account/project/wizard/account_analytic_journal_report_view.xml index b0cb0293270..6d632016ba1 100644 --- a/addons/account/project/wizard/account_analytic_journal_report_view.xml +++ b/addons/account/project/wizard/account_analytic_journal_report_view.xml @@ -10,7 +10,7 @@ - +