跳至內容
選單
此問題已被標幟

This is related to a previous question I asked but I fixed it in V9. Now using V10 it has become an issue again.

I've created a module to connect notes to projects and various other modules. The smart button that links back to the notes has a search context defined so that it displays only the notes associated with that project. The search bar displays the project but is only showing the id, not the name. In V9 I was able to fix it by making sure the models were properly defined. Everything seems correct now and I can think of anything else to check. 

In my project.project I have notes defined:

notes = fields.Many2many(comodel_name="note.note", rel="project_note_rel", column1="project_id", column2="note_id", string="Notes")

In my note.note I have projects defined:

project = fields.Many2many(comodel_name="project.project", rel="project_note_rel", column1="note_id", column2="project_id", string="Project")

In my projects.xml I have a smart button:

<button class="oe_stat_button" type="action" name="%(act_project_2_note)d" icon="fa-sticky-note">
    <field string="Notes" name="note_count" widget="statinfo"/>
</button>

In my notes.xml I have the window action for the smart button:

<act_window id="act_project_2_note"
     name="Notes"
     res_model="note.note"
     view_mode="kanban,tree,form"
     context="{'search_default_project': [active_id], 'default_project': [(4, active_id)]}"/>

And the note search view:

<record id="view_notes_search" model="ir.ui.view">
      <field name="name">triangle.note.search</field>
      <field name="model">note.note</field>
      <field name="inherit_id" ref="note.view_note_note_filter"/>
      <field name="arch" type="xml">
        <data>
          <xpath expr="//search" position="inside">
            <field name="project"/>
            <field name="contact"/>
            <field name="company"/>
            <field name="part"/>
            <field name="lead"/>
            <field name="task"/>
            <field name="issue"/>
            <field name="tool"/>
            <field name="memo"/>
          </xpath>
        </data>
      </field>
    </record>

Anyone know why this issue would be happening??






頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
1
11月 18
5476
1
2月 24
8076
5
5月 17
10663
1
1月 22
14741
1
12月 19
5619