From 39ae5e399bf186d0c3be8f4775abc80e842b1b71 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 24 Sep 2008 10:46:41 +0200 Subject: [PATCH] bugfixes bzr revid: fp@tinyerp.com-20080924084641-hlagbz0xfd8trtgs --- addons/account/account_bank_statement.py | 6 ++--- addons/hr/hr_view.xml | 2 +- addons/product/product.py | 1 + addons/project/project.py | 4 ++-- addons/project_timesheet/project_timesheet.py | 23 +++++++++++-------- addons/stock/product.py | 6 ++--- 6 files changed, 23 insertions(+), 19 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index e4ad52570b9..91ee7d094b1 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -167,8 +167,8 @@ class account_bank_statement(osv.osv): if not (abs(st.balance_end - st.balance_end_real) < 0.0001): raise osv.except_osv(_('Error !'), - _('The statement balance is incorrect !\n' - 'Check that the ending balance equals the computed one.')) + _('The statement balance is incorrect !\n') + + _('The expected balance (%.2f) is different than the computed one. (%.2f)') % (st.balance_end_real, st.balance_end)) if (not st.journal_id.default_credit_account_id) \ or (not st.journal_id.default_debit_account_id): raise osv.except_osv(_('Configration Error !'), @@ -177,7 +177,7 @@ class account_bank_statement(osv.osv): for line in st.move_line_ids: if line.state <> 'valid': raise osv.except_osv(_('Error !'), - _('The account entries lines are not valid.')) + _('The account entries lines are not in valid state.')) for move in st.line_ids: move_id = account_move_obj.create(cr, uid, { diff --git a/addons/hr/hr_view.xml b/addons/hr/hr_view.xml index 5b58d7cf448..060b90fd86a 100644 --- a/addons/hr/hr_view.xml +++ b/addons/hr/hr_view.xml @@ -144,7 +144,7 @@ - Hierarchical view of this employee + Employee Hierarchy ir.actions.act_window hr.employee [('id','in',active_ids)] diff --git a/addons/product/product.py b/addons/product/product.py index 7529b46d837..6e1e70d3e98 100644 --- a/addons/product/product.py +++ b/addons/product/product.py @@ -588,6 +588,7 @@ class product_supplierinfo(osv.osv): } _defaults = { 'qty': lambda *a: 0.0, + 'sequence': lambda *a: 1, 'delay': lambda *a: 1, } _order = 'sequence' diff --git a/addons/project/project.py b/addons/project/project.py index b9878b2888c..55ed7b33df4 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -260,7 +260,7 @@ class task(osv.osv): 'sequence': fields.integer('Sequence'), 'type': fields.many2one('project.task.type', 'Type'), 'state': fields.selection([('draft', 'Draft'),('open', 'Open'),('pending', 'Pending'), ('cancelled', 'Cancelled'), ('done', 'Done')], 'Status', readonly=True, required=True), - 'date_start': fields.datetime('Date'), + 'date_start': fields.datetime('Date Opened'), 'date_deadline': fields.datetime('Deadline'), 'date_close': fields.datetime('Date Closed', readonly=True), 'project_id': fields.many2one('project.project', 'Project', ondelete='cascade'), @@ -289,7 +289,7 @@ class task(osv.osv): 'active': lambda *a: True, 'date_start': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), } - _order = "state, sequence, priority, date_deadline, id" + _order = "sequence, priority, date_deadline, id" # # Override view according to the company definition diff --git a/addons/project_timesheet/project_timesheet.py b/addons/project_timesheet/project_timesheet.py index 2a22b337359..4016abedc44 100644 --- a/addons/project_timesheet/project_timesheet.py +++ b/addons/project_timesheet/project_timesheet.py @@ -14,10 +14,9 @@ class project_work(osv.osv): vals_line={} obj_task = self.pool.get('project.task').browse(cr, uid, vals['task_id']) - vals_line['name']=vals['name'] + vals_line['name']=obj_task.name + ': ' + vals['name'] vals_line['user_id']=vals['user_id'] - c_date=datetime.date(int(vals['date'][:4]),int(vals['date'][5:7]),int(vals['date'][8:10])) - vals_line['date']=c_date + vals_line['date']=vals['date'][:10] vals_line['unit_amount']=vals['hours'] vals_line['account_id']=obj_task.project_id.category_id.id vals_line['amount']=00.0 @@ -32,17 +31,21 @@ class project_work(osv.osv): def write(self, cr, uid, ids,vals,context={}): vals_line={} - line_id=self.pool.get('project.task.work').browse(cr,uid,ids)[0].hr_analytic_timesheet_id + task=self.pool.get('project.task.work').browse(cr,uid,ids)[0] + line_id=task.hr_analytic_timesheet_id # in case,if a record is deleted from timesheet,but we change it from tasks! list_avail_ids=self.pool.get('hr.analytic.timesheet').search(cr,uid,[]) if line_id in list_avail_ids: obj = self.pool.get('hr.analytic.timesheet') - vals_line['name']=vals['name'] - vals_line['user_id']=vals['user_id'] - c_date=datetime.date(int(vals['date'][:4]),int(vals['date'][5:7]),int(vals['date'][8:10])) - vals_line['date']=c_date - vals_line['unit_amount']=vals['hours'] - vals_line['amount']=(-1) * vals['hours'] * obj.browse(cr,uid,line_id).product_id.standard_price + if 'name' in vals: + vals_line['name']=task.name+': '+vals['name'] + if 'user_id' in vals: + vals_line['user_id']=vals['user_id'] + if 'date' in vals: + 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).product_id.standard_price obj.write(cr, uid,[line_id],vals_line,{}) return super(project_work,self).write(cr, uid, ids,vals,context) diff --git a/addons/stock/product.py b/addons/stock/product.py index 4861b86d380..d03a1c9a15c 100644 --- a/addons/stock/product.py +++ b/addons/stock/product.py @@ -32,11 +32,11 @@ from osv import fields, osv class product_product(osv.osv): _inherit = "product.product" - def __old_view_header_get(self, cr, user, view_id, view_type, context): + def view_header_get(self, cr, user, view_id, view_type, context): res = super(product_product, self).view_header_get(cr, user, view_id, view_type, context) if res: return res if (context.get('location', False)): - return _('Products: ')+self.pool.get('stock.location').browse(cr, uid, context['location'], context).name + return _('Products: ')+self.pool.get('stock.location').browse(cr, user, context['location'], context).name return res def get_product_available(self,cr,uid,ids,context={}): @@ -156,7 +156,7 @@ class product_product(osv.osv): 'track_incoming' : fields.boolean('Track Incomming Lots', help="Force to use a Production Lot during receptions"), 'track_outgoing' : fields.boolean('Track Outging Lots', help="Force to use a Production Lot during deliveries"), } - def __old_fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False): + def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False): res = super(product_product,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar) if ('location' in context) and context['location']: location_info = self.pool.get('stock.location').browse(cr, uid, context['location'])