我为 ir.attachemnt
定义了 Many2many
字段 . 问题是我可以'看到 Add an item
链接添加记录 .
*.py
attachment_ids = fields.Many2many('ir.attachment', string='Attachments')
*.xml
<notebook>
<page string='Attachments'>
<field name="attachment_ids"/>
</page>
</notebook>
我也试过这个:
<field name="attachment_ids" widget="many2many" />
任何的想法?
1 回答
只有两件事让Odoo表现得像这样 .
您的视图处于编辑模式但我认为我看到一个占位符
comments
这意味着情况并非如此不允许您的用户创建
ir.attachment
,更有可能不是这种情况您的字段是只读的 .
如果不是这种情况中的一个是有线的,但是如果您不了解发生了什么,可以通过使用嵌入式树并将create attribute设置为true来强制显示该链接