bugfix_utf8

bzr revid: fp@tinyerp.com-20090402154210-53vzr5n5j5gc6u1c
This commit is contained in:
Fabien Pinckaers
2009-04-02 17:42:10 +02:00
4 changed files with 7 additions and 13 deletions
@@ -190,7 +190,7 @@ class account_analytic_plan_instance(osv.osv):
if self.pool.get('account.analytic.account').search(cr,uid,[('parent_id','child_of',[item.root_analytic_id.id]),('id','=',tempo[2]['analytic_account_id'])]):
total_per_plan += tempo[2]['rate']
if total_per_plan < item.min_required or total_per_plan > item.max_required:
raise osv.except_osv(_('Value Error') ,_('The Total Should be Between %s and %s" % (str(item.min_required), str(item.max_required))))
raise osv.except_osv(_('Value Error') ,_('The Total Should be Between %s and %s') % (str(item.min_required), str(item.max_required)))
return super(account_analytic_plan_instance, self).create(cr, uid, vals, context)
+1 -7
View File
@@ -3,6 +3,7 @@
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# Copyright (C) 2008-2009 B2CK, Cedric Krier, Bertrand Chenal (the methods "check_vat_[a-z]{2}"
# $Id$
#
# This program is free software: you can redistribute it and/or modify
@@ -20,13 +21,6 @@
#
##############################################################################
#
# The methods "check_vat_[a-z]{2}" are copyrighted:
# - Cedric Krier.
# - Bertrand Chenal
# - B2CK
#
from osv import osv
from osv import fields
@@ -152,9 +152,9 @@ class invoice_create(wizard.interface):
details.append(line['name'])
#if data['form']['price']:
# details.append(abs(line['amount']))
note.append(' - '.join(map(str,details)))
note.append(' - '.join(map(lambda x: x or '',details)))
curr_line['note'] = "\n".join(map(str,note))
curr_line['note'] = "\n".join(map(lambda x: x or '',note))
pool.get('account.invoice.line').create(cr, uid, curr_line)
strids = ','.join(map(str, data['ids']))
cr.execute("update account_analytic_line set invoice_id=%%s WHERE account_id = %%s and id IN (%s)" % strids, (last_invoice,account.id,))
@@ -85,15 +85,15 @@ class project_work(osv.osv):
vals_line['date'] = vals['date'][:10]
if 'hours' in vals:
vals_line['unit_amount'] = vals['hours']
vals_line['amount'] = (-1) * vals['hours'] * obj.browse(cr, uid, line_id.id).product_id.standard_price
obj.write(cr, uid, [line_id.id], vals_line, {})
vals_line['amount'] = (-1) * vals['hours'] * obj.browse(cr, uid, line_id).product_id.standard_price
obj.write(cr, uid, [line_id], vals_line, {})
return super(project_work,self).write(cr, uid, ids, vals, context)
def unlink(self, cr, uid, ids, *args, **kwargs):
for timesheet_id in self.pool.get('project.task.work').browse(cr, uid, ids):
if timesheet_id.hr_analytic_timesheet_id:
obj = self.pool.get('hr.analytic.timesheet').unlink(cr, uid, [timesheet_id.hr_analytic_timesheet_id.id], *args, **kwargs)
obj = self.pool.get('hr.analytic.timesheet').unlink(cr, uid, [timesheet_id.hr_analytic_timesheet_id], *args, **kwargs)
return super(project_work,self).unlink(cr, uid, ids, *args, **kwargs)
_columns={