[MERGE]: merging from the same branch

bzr revid: mga@tinyerp.com-20090914104909-1r92mv23cdxw6jqd
This commit is contained in:
Mantavya Gajjar 2009-09-14 16:19:09 +05:30
commit f30db50e9a
6 changed files with 16 additions and 17 deletions

View File

@ -429,8 +429,9 @@ class account_invoice(osv.osv):
ait_obj = self.pool.get('account.invoice.tax')
for id in ids:
cr.execute("DELETE FROM account_invoice_tax WHERE invoice_id=%s", (id,))
partner = self.browse(cr, uid, id).partner_id
context.update({'lang': partner.lang})
partner = self.browse(cr, uid, id,context=context).partner_id
if partner.lang:
context.update({'lang': partner.lang})
for taxe in ait_obj.compute(cr, uid, id, context=context).values():
ait_obj.create(cr, uid, taxe)
# Update the stored value (fields.function), so we write to trigger recompute

View File

@ -145,14 +145,11 @@ class base_module_record(osv.osv):
newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1])
if not newid:
newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2])
# if valitem[0]==0:
# newid = self._create_id(cr, uid, fields[key]['relation'], valitem[2])
# else:
# newid,update = self._get_id(cr, uid, fields[key]['relation'], valitem[1])
self.ids[(fields[key]['relation'], valitem[1])] = newid
childrecord, update = self._create_record(cr, uid, doc, fields[key]['relation'],valitem[2], newid)
noupdate = noupdate or update
record_list += childrecord
self.ids[(fields[key]['relation'],newid)] = newid
else:
pass
elif fields[key]['type'] in ('many2many',):
@ -161,7 +158,7 @@ class base_module_record(osv.osv):
if valitem[0]==6:
for id2 in valitem[2]:
id,update = self._get_id(cr, uid, fields[key]['relation'], id2)
self.ids[(fields[key]['relation'],id)] = id
self.ids[(fields[key]['relation'],id2)] = id
noupdate = noupdate or update
res.append(id)
field = doc.createElement('field')
@ -265,7 +262,7 @@ class base_module_record(osv.osv):
elif rec[4]=='create':
id = self._create_id(cr, uid, rec[3],rec[5])
record,noupdate = self._create_record(cr, uid, doc, rec[3], rec[5], id)
self.ids[(rec[3],result)] = id
self.ids[(rec[3], result)] = id
record_list += record
elif rec[4]=='copy':
@ -276,7 +273,7 @@ class base_module_record(osv.osv):
self.recording_data=rec_data
id = self._create_id(cr, uid, rec[3],rec[6])
record,noupdate = self._create_record(cr, uid, doc, rec[3], rec[6], id)
self.ids[(rec[3],result)] = id
self.ids[(rec[3], result)] = id
record_list += record
return record_list,noupdate

View File

@ -89,7 +89,7 @@ def _record_objects(self, cr, uid, data, context):
search_ids=obj_pool.search(cr,uid,search_condition)
for s_id in search_ids:
args=(cr.dbname,uid,user,obj_name,'copy',s_id,{},context)
mod.recording_data.append(('query',args, {},s_id))
mod.recording_data.append(('query',args, {}, s_id))
return {}
def inter_call(self,cr,uid,data,context):

View File

@ -63,8 +63,8 @@ def content_index(content, filename=None, content_type=None):
s.close()
elif ext in ('.txt','.py','.patch','.html','.csv','.xml'):
result = content
else:
result = content
#else:
# result = content
return result
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -576,7 +576,7 @@ class hr_timesheet_sheet_sheet_day(osv.osv):
sheet_id,
total_timesheet,
total_attendance,
(total_attendance - total_timesheet) AS total_difference
round(cast((total_attendance - total_timesheet) as Numeric),2) AS total_difference
FROM
((
SELECT

View File

@ -280,7 +280,7 @@ class task(osv.osv):
'planned_hours': fields.float('Planned Hours', required=True, help='Estimated time to do the task, usually set by the project manager when the task is in draft state.'),
'effective_hours': fields.function(_hours_get, method=True, string='Hours Spent', multi='hours', store=True, help="Computed using the sum of the task work done."),
'remaining_hours': fields.float('Remaining Hours', digits=(16,2), help="Total remaining time, can be re-estimated periodically by the assignee of the task."),
'remaining_hours': fields.float('Remaining Hours', digits=(16,4), help="Total remaining time, can be re-estimated periodically by the assignee of the task."),
'total_hours': fields.function(_hours_get, method=True, string='Total Hours', multi='hours', store=True, help="Computed as: Time Spent + Remaining Time."),
'progress': fields.function(_hours_get, method=True, string='Progress (%)', multi='hours', store=True, help="Computed as: Time Spent / Total Time."),
'delay_hours': fields.function(_hours_get, method=True, string='Delay Hours', multi='hours', store=True, help="Computed as: Total Time - Estimated Time. It gives the difference of the time estimated by the project manager and the real time to close the task."),
@ -433,8 +433,9 @@ class project_work(osv.osv):
def write(self, cr, uid, ids,vals,context={}):
if 'hours' in vals and (not vals['hours']):
vals['hours'] = 0.00
for work in self.browse(cr, uid, ids, context):
cr.execute('update project_task set remaining_hours=remaining_hours - %s + (%s) where id=%s', (vals.get('hours',0.0), work.hours, work.task_id.id))
if 'hours' in vals:
for work in self.browse(cr, uid, ids, context):
cr.execute('update project_task set remaining_hours=remaining_hours - %s + (%s) where id=%s', (vals.get('hours',0.0), work.hours, work.task_id.id))
return super(project_work,self).write(cr, uid, ids, vals, context)
def unlink(self, cr, uid, ids, *args, **kwargs):