首页 > 其他 > 详细

odoo创建编号

时间:2017-06-09 11:01:45      阅读:380      评论:0      收藏:0      [点我收藏+]
def create(self,cr,uid,vals,context=None):
if context is None:
context ={}
print 111111
print vals
[]
if vals.get(‘lx_origin‘, ‘/‘) == ‘/‘ :
vals[‘lx_origin‘] = self.pool.get(‘ir.sequence‘).get(cr, uid, ‘demo.contract.lx‘, context=context) or ‘/‘
if vals[‘lx_origin‘] and vals[‘lx_type‘]==‘3‘:
vals[‘lx_origin‘]=vals[‘lx_origin‘]+‘S‘

elif vals[‘lx_origin‘] and vals[‘lx_type‘]==‘4‘ :
vals[‘lx_origin‘]=vals[‘lx_origin‘]+‘S(LX)‘

elif vals[‘lx_origin‘] and vals[‘lx_type‘]==‘5‘ :
vals[‘lx_origin‘]=vals[‘lx_origin‘]+‘C‘


elif vals[‘lx_origin‘] and vals[‘lx_type‘]==‘6‘ :
vals[‘lx_origin‘]=vals[‘lx_origin‘]+‘C(LX)‘
else:
vals[‘lx_origin‘]=vals[‘lx_origin‘]

if vals[‘lx_origin‘] and vals[‘display_name‘]==14:
vals[‘lx_origin‘]=‘HL‘+vals[‘lx_origin‘]

elif vals[‘lx_origin‘] and vals[‘display_name‘]==19:
vals[‘lx_origin‘]=‘TZRL‘+vals[‘lx_origin‘]

elif vals[‘lx_origin‘] and vals[‘display_name‘]==18:
vals[‘lx_origin‘]=‘JT‘+vals[‘lx_origin‘]

elif vals[‘lx_origin‘] and vals[‘display_name‘]==17:
vals[‘lx_origin‘]=‘YC‘+vals[‘lx_origin‘]

elif vals[‘lx_origin‘] and vals[‘display_name‘]==22:
vals[‘lx_origin‘]=‘XN‘+vals[‘lx_origin‘]

elif vals[‘lx_origin‘] and vals[‘display_name‘]==3 or vals[‘display_name‘]==13 or vals[‘display_name‘]==11:
vals[‘lx_origin‘]=‘FSD‘+vals[‘lx_origin‘]

else:
vals[‘lx_origin‘]=vals[‘lx_origin‘]



new_id=super(demo_contract_lx,self).create(cr,uid,vals,context=context)
return new_id



FSDLX2017-070S(LX)

odoo创建编号

原文:http://www.cnblogs.com/1314520xh/p/6970817.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!