首页 > 其他 > 详细

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

时间:2018-11-14 16:26:43      阅读:425      评论:0      收藏:0      [点我收藏+]

按钮传递上下文:

                <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>

技术分享图片

视图中加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开发笔记 -- 传递上下文实现列表视图按照指定条件过滤显示

原文:https://www.cnblogs.com/hellojesson/p/9958354.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!