按钮传递上下文:

                <xpath expr="//div[@name='dec_work_sheet_id']" position="after">
                    <div class="col-lg-5 oe_button_box" name="button_box" style="width: 400px;">
                        <button name="%(cus_center_jiali_ext.copy_customs_declaration_action)d" type="action"
                                class="oe_stat_button" icon="fa-align-justify"
                                context="{'context_name': name, 'domain_dec_team_id': dec_team_id}"
                                style="width: 120px !important;margin: 0px 2px -1px 0px;" string="***单复制">
                        </button>
                    </div>
                </xpath>

odoo开发笔记 -- 传递上下文实现列表视图按照指定条件过滤显示

视图中加domain获取上下文,添加过滤条件:

        <record id="copy_customs_declaration_action" model="ir.actions.act_window">
            <field name="name">***单复制</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">cus_center_new.customs_dec</field>
            <field name="view_mode">tree,form</field>
            <field name="domain">[('dec_team_id', '=', domain_dec_team_id)]</field>
        </record>

 

odoo开发笔记 -- 传递上下文实现列表视图按照指定条件过滤显示

 

相关文章:

  • 2021-12-17
  • 2021-11-12
  • 2023-02-20
  • 2023-02-08
  • 2021-05-29
  • 2022-12-23
  • 2021-10-15
猜你喜欢
  • 2021-05-27
  • 2022-01-21
  • 2021-06-06
  • 2021-09-28
  • 2021-07-22
  • 2021-07-05
  • 2022-03-03
相关资源
相似解决方案