[MERGE] merge from trunk addons

bzr revid: mra@mra-laptop-20101006125131-8xf4r5tz49dkf6g3
This commit is contained in:
Mustufa Rangwala
2010-10-06 18:21:31 +05:30
5 changed files with 26 additions and 27 deletions
+6 -7
View File
@@ -978,7 +978,7 @@ class calendar_event(osv.osv):
if not context:
context = {}
for event_id in ids:
cr.execute('select id from %s where recurrent_uid=%s' % (self._table, event_id))
cr.execute("select id from %s where recurrent_uid=%%s" % (self._table), (event_id,))
r_ids = map(lambda x: x[0], cr.fetchall())
self.unlink(cr, uid, r_ids, context=context)
return True
@@ -1065,7 +1065,7 @@ class calendar_event(osv.osv):
'rule_type': rrule_type,
'id': id,
})
cr.execute(qry, val) # Hopefully psycopg2 works with dicts. But, FIXME
cr.execute(qry % val)
return True
def _get_rulestring(self, cr, uid, ids, name, arg, context=None):
@@ -1438,7 +1438,8 @@ true, it will allow you to hide the event alarm information without removing it.
res = super(calendar_event, self).search(cr, uid, args_without_date, \
offset, limit, order, context, count)
return self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit)
res = self.get_recurrent_ids(cr, uid, res, start_date, until_date, limit)
return res
def write(self, cr, uid, ids, vals, context=None, check=True, update_check=True):
"""
@@ -1533,11 +1534,9 @@ true, it will allow you to hide the event alarm information without removing it.
if fields and 'date' not in fields:
fields.append('date')
real_ids = [item2 for item1, item2 in select]
event_values = dict([(res['id'], res) for res in super(calendar_event, self).read(cr, uid, real_ids, fields=fields, context=context, load=load)])
for base_calendar_id, real_id in select:
res = event_values[real_id]
#REVET: Revision ID: olt@tinyerp.com-20100924131709-cqsd1ut234ni6txn
res = super(calendar_event, self).read(cr, uid, real_id, fields=fields, context=context, load=load)
ls = base_calendar_id2real_id(base_calendar_id, with_date=res and res.get('duration', 0) or 0)
if not isinstance(ls, (str, int, long)) and len(ls) >= 2:
res['date'] = ls[1]
+3 -2
View File
@@ -63,11 +63,12 @@ def uid2openobjectid(cr, uidval, oomodel, rdate):
return (False, None)
qry = 'SELECT DISTINCT(id) FROM %s' % model_obj._table
if rdate:
qry += " WHERE recurrent_id=%s"
cr.execute(qry, (rdate,))
qry += " where recurrent_id='%s'" % (rdate) #TOFIX: sql injection
cr.execute(qry)
r_id = cr.fetchone()
if r_id:
return (id, r_id[0])
cr.execute(qry)
ids = map(lambda x: str(x[0]), cr.fetchall())
if id in ids:
@@ -92,7 +92,7 @@ class project_phase(osv.osv):
model_data_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
return model_data_obj.read(cr, uid, [model_data_id], ['res_id'])[0]['res_id']
def _compute(self, cr, uid, ids, context=None):
def _compute(self, cr, uid, ids,field_name, arg, context=None):
res = {}
if not ids:
return res
@@ -100,9 +100,7 @@ class project_phase(osv.osv):
tot = 0.0
for task in phase.task_ids:
tot += task.planned_hours
res[phase.id] = {
'total_hours' : tot
}
res[phase.id] = tot
return res
_columns = {
@@ -110,22 +110,23 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Project Phase">
<group colspan="6" col="6">
<group colspan="2" col="2">
<group colspan="8" col="7">
<group colspan="8">
<field name="name" select="1"/>
<field name="date_start"/>
<field name="total_hours"/>
<field name="project_id" on_change="onchange_project(project_id)" colspan="2"/>
<field name="responsible_id" colspan="2"/>
</group>
<group colspan="2" col="4">
<field name="project_id" on_change="onchange_project(project_id)" colspan="4"/>
<newline/>
<field name="duration" colspan="1" on_change="onchange_days(project_id)" />
<newline/>
<group colspan="2">
<field name="date_start"/>
<field name="date_end"/>
</group>
<group colspan="2">
<field name="duration" on_change="onchange_days(project_id)"/>
<field name="product_uom" nolabel="1" domain="[('category_id.name', '=', 'Working Time')]"/>
</group>
<group colspan="2" col="2">
<field name="responsible_id"/>
<field name="date_end"/>
</group>
</group>
</group>
<notebook colspan="4">
<page string="Resource Allocation">
<field colspan="4" name="resource_ids" nolabel="1">
+2 -2
View File
@@ -43,8 +43,8 @@ class report_stock_move(osv.osv):
'location_id': fields.many2one('stock.location', 'Source Location', readonly=True, select=True, help="Sets a location if you produce at a fixed location. This can be a partner location if you subcontract the manufacturing operations."),
'location_dest_id': fields.many2one('stock.location', 'Dest. Location', readonly=True, select=True, help="Location where the system will stock the finished products."),
'state': fields.selection([('draft', 'Draft'), ('waiting', 'Waiting'), ('confirmed', 'Confirmed'), ('assigned', 'Available'), ('done', 'Done'), ('cancel', 'Cancelled')], 'State', readonly=True, select=True),
'product_qty_in':fields.integer('In Qty',readonly=True),
'product_qty_out':fields.integer('Out Qty',readonly=True),
'product_qty_in':fields.float('In Qty',readonly=True),
'product_qty_out':fields.float('Out Qty',readonly=True),
'value' : fields.float('Total Value', required=True, digits_compute=dp.get_precision('Sale Price')),
'day_diff2':fields.float('Delay (Days)',readonly=True, digits=(16,2), group_operator="avg"),
'day_diff1':fields.float('Planned (Days)',readonly=True, digits=(16,2), group_operator="avg"),