[FIX] Fleet : purchaser_id should not be UID, but a partner ID related to that UID

lp bug: https://launchpad.net/bugs/1089876 fixed

bzr revid: support@serpentcs.com-20121216192037-1kexe37j0omowgvx
This commit is contained in:
Serpent Consulting Services 2012-12-17 00:50:37 +05:30
parent 0c5bf7e819
commit b2adcbef02
1 changed files with 1 additions and 1 deletions

View File

@ -787,7 +787,7 @@ class fleet_vehicle_log_contract(osv.Model):
'cost_amount': fields.related('cost_id', 'amount', string='Amount', type='float', store=True), #we need to keep this field as a related with store=True because the graph view doesn't support (1) to address fields from inherited table and (2) fields that aren't stored in database
}
_defaults = {
'purchaser_id': lambda self, cr, uid, ctx: uid,
'purchaser_id': lambda self, cr, uid, ctx: self.pool.get('res.users').browse(cr, uid, uid, context=ctx).partner_id.id or False,
'date': fields.date.context_today,
'start_date': fields.date.context_today,
'state':'open',