0

这是字段信息,但未显示在网页中

'type': fields.selection([('country','Country'),('state','State')],'Type'), 

在我看来,该领域是

<field name="type"/>
4

1 回答 1

0

我看不出你的代码有什么问题。可能还有其他原因导致您的问题。但是,您可以尝试稍微更改您的代码:将选择声明为类外的全局变量:

choice = (('country','Country'),('state','State'))

然后在你的课上:

'type_': fields.selection(choice,string='Type'),

您的 xml 没问题,但您可以尝试添加 widget="selection":

<field name="type_" widget="selection"/>

请注意,我将您的字段重命名为type_type可能被保留。

于 2013-07-05T09:09:32.053 回答