【问题标题】:Odoo's qweb groups_idOdoo qweb group_id
【发布时间】:2020-11-19 11:26:30
【问题描述】:

使用 Odoo 的 Qweb,我想将限制应用于操作。 我想将一些联系人删除到“is_b2c”为 True 的列表中。

 <record id="action_contacts" model="ir.actions.act_window">
     <field name="name">Contacts</field>
     <field name="type">ir.actions.act_window</field>
     <field name="res_model">res.partner</field>
     <field name="view_type">form</field>
     <field name="view_mode">kanban,tree,form</field>
     <field name="search_view_id" ref="base.view_res_partner_filter"/>
     <field name="help" type="html">
       <p class="oe_view_nocontent_create">
         Click to add a contact in your contacts directory.
       </p><p>
         Odoo helps you easily track all activities related to
         a customer: discussions, history of business opportunities,
         documents, etc.
       </p>
     </field>
 </record>

限制必须是:

 <record id="contacts.action_contacts" model="ir.actions.act_window">
        <field name="type">ir.actions.act_window</field>
        <field name="view_type">form</field>
        <field name="view_mode">kanban,tree,form</field>
        <field name="domain">
         [
            ('is_b2c','=', False) <!-- Get contacts with 'is_b2c' is False for -->
         ]
        </field>
        <!-- for this group name only -->
        <field name="groups_id" eval="[(6,0,[ref('sales_team.group_sale_salesman')])]"/>
     </record>


Thanks

【问题讨论】:

    标签: odoo-11 qweb qwebengineview


    【解决方案1】:

    不要在操作上添加组,而是创建两个单独的菜单项,同时创建两个单独的操作,然后在这些菜单项上添加组。在其中一项操作中添加域以仅显示限制联系人。

    【讨论】:

      猜你喜欢
      • 2023-03-13
      • 1970-01-01
      • 1970-01-01
      • 2020-07-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多