标签:select pac 选择 fetch list price back elf 方式
# 输入产品带出它默认的包装方式\单位\品名\规格
def get_product_unit(self, cr, uid,ids,product_id,pcust_order_no,pdate_planned,partner_id,context=None): if partner_id: result={} try: result[‘cust_order_no‘]=pcust_order_no#zxs 从上一级获取客户订单号 result[‘date_planned‘]=pdate_planned #zxs 从上一级获取交期 result[‘partner_id‘]=partner_id #zxs 从上一级获取客户 productobj = self.pool.get(‘product.product‘) produtt_obj=productobj.browse(cr,uid,[product_id],context=None) result[‘pname‘]=produtt_obj.material result[‘spec‘]=produtt_obj.cust_spec result[‘product_uom‘]=produtt_obj.uom_id.id result[‘packing_type1‘]=produtt_obj.packing_type1
//最近订单
sql="select price_unit from sale_price_list where partner_id=%d and product_id=%d order by write_date desc limit 1"%(partner_id,product_id) cr.execute(sql) dict=cr.fetchall() if dict: result[‘price‘]=dict[0][0] else: result[‘price‘]=0 return {‘value‘:result} except Exception, ex: return False else:
raise osv.except_osv((u‘警告!‘),(u‘请先选择客户‘))
标签:select pac 选择 fetch list price back elf 方式
原文地址:http://www.cnblogs.com/1314520xh/p/6853688.html