当创建我想删除product_name
下product_id
一个新的采购订单所以,我没有这样的功能:显示产品default_code
class snc_product(osv.osv):
_name='product.product'
_inherit='product.product'
def name_get(self, cr, uid, ids, context=None):
return_val = super(snc_product, self).name_get(cr, uid, ids, context=context)
res = []
def _name_get(d):
code = d.get('code','')
if d.get('variants'):
code = code + ' - %s' % (d['variants'],)
return (d['id'], code)
for product in self.browse(cr, uid, ids, context=context):
res.append((product.id, (product.code)))
return res or return_val
现在的问题是,即使在描述我获取default_code而不是名称。
我该如何解决这个问题?
请格式化你的代码,使其在某种程度上readble –
有谁如何解决呢??? –