[IMP] sale, point_of_sale: use lambda with time.strftime in _defaults
bzr revid: psi@tinyerp.co.in-20101104122741-du08a4bt4031dhos
This commit is contained in:
parent
3d38b13c05
commit
f42cc55258
|
@ -305,7 +305,7 @@ class pos_order(osv.osv):
|
|||
'state': 'draft',
|
||||
'price_type': 'tax_excluded',
|
||||
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'pos.order'),
|
||||
'date_order': time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'date_order': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'date_validity': lambda *a: (datetime.today() + relativedelta(months=+6)).strftime('%Y-%m-%d'),
|
||||
'nb_print': 0,
|
||||
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
|
||||
|
|
|
@ -32,8 +32,8 @@ class pos_details(osv.osv_memory):
|
|||
'date_end': fields.date('Date End', required=True)
|
||||
}
|
||||
_defaults = {
|
||||
'date_start': time.strftime('%Y-%m-%d'),
|
||||
'date_end': time.strftime('%Y-%m-%d'),
|
||||
'date_start': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'date_end': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
}
|
||||
|
||||
def print_report(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -57,8 +57,8 @@ class pos_payment_report_date(osv.osv_memory):
|
|||
'user_id': fields.many2many('res.users', 'res_user_sale', 'user_id', 'sale_id', 'Salesman')
|
||||
}
|
||||
_defaults = {
|
||||
'date_start': time.strftime('%Y-%m-%d'),
|
||||
'date_end': time.strftime('%Y-%m-%d'),
|
||||
'date_start': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'date_end': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
}
|
||||
|
||||
pos_payment_report_date()
|
||||
|
|
|
@ -286,7 +286,7 @@ class sale_order(osv.osv):
|
|||
}
|
||||
_defaults = {
|
||||
'picking_policy': 'direct',
|
||||
'date_order': time.strftime('%Y-%m-%d'),
|
||||
'date_order': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'order_policy': 'manual',
|
||||
'state': 'draft',
|
||||
'user_id': lambda obj, cr, uid, context: uid,
|
||||
|
|
Loading…
Reference in New Issue