Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
5124 Visualizzazioni

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
nov 18
5483
1
feb 24
8088
5
mag 17
10666
1
gen 22
14772
1
dic 19
5633