currecy_so_po_improve

bzr revid: rmu@tinyerp.com-20130304112206-dk1486i17igx33g0
This commit is contained in:
Ravish (Open ERP) 2013-03-04 16:52:06 +05:30
parent 9b31288c14
commit cca957c716
1 changed files with 2 additions and 1 deletions

View File

@ -224,7 +224,7 @@ class purchase_order(osv.osv):
'create_uid': fields.many2one('res.users', 'Responsible'),
'company_id': fields.many2one('res.company','Company',required=True,select=1, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)]}),
'journal_id': fields.many2one('account.journal', 'Journal'),
'currency_id': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id
}
_defaults = {
'date_order': fields.date.context_today,
@ -236,6 +236,7 @@ class purchase_order(osv.osv):
'pricelist_id': lambda self, cr, uid, context: context.get('partner_id', False) and self.pool.get('res.partner').browse(cr, uid, context['partner_id']).property_product_pricelist_purchase.id,
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'purchase.order', context=c),
'journal_id': _get_journal,
'currency_id': lambda self, cr, uid, context: self.pool.get('res.users').browse(cr, uid, uid, context=context).company_id.currency_id.id
}
_sql_constraints = [
('name_uniq', 'unique(name, company_id)', 'Order Reference must be unique per Company!'),