Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged

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






Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
1
lis 18
5431
1
úno 24
8014
5
kvě 17
10597
1
led 22
14662
1
pro 19
5542