跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

  1. 主页
  2. 版块
  3. Odoo 新手求助
  4. 怎么通过xml继承方式修改原模块的view的domain

怎么通过xml继承方式修改原模块的view的domain

已定时 已固定 已锁定 已移动 Odoo 新手求助
2 帖子 1 发布者 4.0k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • JoshuaJ 离线
    JoshuaJ 离线
    Joshua 管理员
    写于 最后由 编辑
    #1

    在6.0.x的OpenERP里,如果我想修改一下原模块的一个view里面的domain应该怎么实现呢?
    例如:

    <br />&lt;record model=&quot;ir.actions.act_window&quot; id=&quot;crm_case_category_act_leads_all&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;name&quot;&gt;Leads&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;res_model&quot;&gt;crm.lead&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;view_mode&quot;&gt;tree,form&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;domain&quot;&gt;&#91;&#039;|&#039;, (&#039;type&#039;,&#039;=&#039;,&#039;lead&#039;), (&#039;type&#039;,&#039;=&#039;,False)]&lt;/field&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;view_id&quot; ref=&quot;crm_case_tree_view_leads&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;search_view_id&quot; ref=&quot;crm.view_crm_case_leads_filter&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &lt;field name=&quot;context&quot;&gt;{&#039;search_default_current&#039;:1, &#039;default_type&#039;: &#039;lead&#039;, &#039;search_default_section_id&#039;: section_id, &#039;stage_type&#039;: &#039;lead&#039;}&lt;/field&gt;<br /><br />
    



    我想把原来的domain改成[('type','=','lead')],但是不想通过在页面上修改xml,

    欢迎集思广益
    解决方案:

    1.<filed name="action_id" search="[('model', '=', 'xxxxx'),('view_type', '=', 'form').....] (by.mrshelly)
    <field name="action_id" >abc</field> 表示在字段action_id中导入固定值abc,但如果希望搜索数据表中某个值,作为导入值,就可以用search:<filed name="action_id" search="[('model', '=', 'xxxxx'),('view_type', '=', 'form').....]  搜索符合条件的值作为action_id 的字段值
    2.拷贝那个Action,重写,保持ID不变,就可以覆盖它了,Form也一样,或者继承,继承解决不了问题,拷贝下来重写,保持ID不变就OK了,在你的新模块中,老ID要加上老模块名。(by.老肖)


    【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

    1 条回复 最后回复
    0

    • 登录

    • 没有帐号? 注册

    • 登录或注册以进行搜索。
    • 第一个帖子
      最后一个帖子
    0
    • 版块
    • 标签
    • 热门
    • 用户
    • 群组