第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

字段之間的關(guān)系-類OpenErp

字段之間的關(guān)系-類OpenErp

湖上湖 2021-03-16 16:19:29
我需要將一個(gè)首先聲明的字段與product.py我正在制作的自定義模塊相關(guān)聯(lián)。這些字段在product.product類中如下所示:_name = "product.product"_description = "Product"_table = "product_product"_inherits = {'product.template': 'product_tmpl_id'}_inherit = ['mail.thread']_order = 'default_code,name_template'_columns = {    'codigo_n' : fields.char('Codigo Arancelario', size=64),    'tec_esp' : fields.char('Especificaciones tecnicas', size=72),    'qty_available': fields.function(_product_qty_available, type='float', string='Quantity On Hand'),    'virtual_available': fields.function(_product_virtual_available, type='float', string='Quantity Available'),    'incoming_qty': fields.function(_product_incoming_qty, type='float', string='Incoming'),    'outgoing_qty': fields.function(_product_outgoing_qty, type='float', string='Outgoing'),    'price': fields.function(_product_price, type='float', string='Price', digits_compute=dp.get_precision('Product Price')),    'lst_price' : fields.function(_product_lst_price, type='float', string='Public Price', digits_compute=dp.get_precision('Product Price')),    'code': fields.function(_product_code, type='char', string='Internal Reference'),    'partner_ref' : fields.function(_product_partner_ref, type='char', string='Customer ref'),它不是所有的product.py代碼btw,但是它顯示了我需要關(guān)聯(lián)的兩個(gè)字段,即前兩個(gè)codigo_n和tec_esp,并且我在自定義模塊中繼承了該類,如下所示:_name = 'certificados.line'_description = "Items del Certificado"_inherit = 'product.product'def multi_a_b(self, cr, uid, ids, name, arg, context=None):    res = {}    for record in self.browse(cr, uid, ids,context):        res[record.id] = record.Cantidad * record.Precio_Unitario_Declarado    return res據(jù)我所知,如果我繼承_name原始對(duì)象,我應(yīng)該繼承它的所有字段,然后添加在新類上聲明的新字段。問(wèn)題是,我不太確定如何繼承這兩個(gè)類型的字段,這些字段char已經(jīng)嘗試過(guò)one2many,然后many2one在自定義模塊中調(diào)用它們,但是它返回一個(gè)None關(guān)系,我該如何實(shí)現(xiàn)呢?
查看完整描述

2 回答

  • 2 回答
  • 0 關(guān)注
  • 132 瀏覽
慕課專欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)