【发布时间】:2021-06-18 09:55:08
【问题描述】:
我在模型“product.template”的操作中添加了一个向导,我想在向导中获取“active_ids”,我尝试使用此代码:
class Wizard(models.TransientModel):
_name = "product.wizard"
product_template_ids = fields.Many2many('product.template')
@api.model
def default_get(self, fields):
res = super(Wizard, self).default_get(fields)
res['product_template_ids'] = self.env.context.get('active_ids', False)
return res
但是,我得到了这个错误:raise exception.with_traceback(None) from new_cause TypeError: 'int' 对象不可下标
怎么了?有什么帮助吗?
谢谢。
【问题讨论】:
标签: javascript python xml odoo