當創建我想刪除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 –
有誰如何解決呢??? –