Odoo 中文社区

    • 注册
    • 登录
    • 搜索
    • 版块
    • 标签
    • 热门
    • 用户
    • 群组

    Odoo中文社区可以通过以下两个域名访问:shine-it.net , odoo.net.cn

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

    开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

    如果您登录系统碰到问题,请在微信公众号留言:

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

    Odoo 新手求助
    1
    2
    3940
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • Joshua
      Joshua 管理员 最后由 编辑

      在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
      • First post
        Last post