# 输入产品带出它默认的包装方式\单位\品名\规格
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#
result['date_planned']=pdate_planned
result['partner_id']=partner_id
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'请先选择客户'))