当我尝试此代码时,操作模块将作为原始“审计”审计模块: 在audit.py中:
class action(orm.Model):
_inherit = "action"
def __init__(self, pool, cr):
"""Add a new audit value"""
return super(action, self).Origin_SELECTION.append(('audit', 'Audit'))
在action.py中我们有:
Origin_SELECTION=[('dysfunction','Dysfunction')]
origin_act = fields.Selection(Origin_SELECTION, 'Origin')
在最终选择字段中,'审核'选项出现了2次。
答案 0 :(得分:0)
尝试:
class my_model(orm.Model): _inherit ='my.model'
def _type_selection(self, cr, uid, context=None):
selection = super(my_model, self)._type_selection(cr, uid, context=context)
selection.append(('special', 'Special'))
return selection
答案 1 :(得分:0)
请尝试以下链接参考: