Skip to Content
Menu
This question has been flagged
2 Replies
2371 Views

Hi everybody,


I need help again about a problem of display when i want to show a one2many field in a form.

I try to do a relation between a field I add in purchase order form, with a project module, who ll have the record of one or many purchase order

The relation looks working, I could add it in purchase order, and when i go to my project module and open the project object i selected before in my purchase order, the first line in the tree who should display all purchase order in relation, is cut but clickable, and could open, on click, the right purchase order.


When i go to edit that project, the tree tab display well, and the first line in the tree show no name, a blank case with option to delete it at the end of the line.

When I click on that blank record, I could find the list of PO who's existing in the DB...

I think I forget something but don't know why. Is someone understand it? Let me know if you need more info.


class project(models.Model):
    _name = 'xxxxx.project'
    _description = 'xxxxxx Project Information'
    _rec_name = 'project_seq'

    project_purchase_order = fields.One2many('purchase.order', 'purchase_project_id', string="Purchase Order #")
       
   
class purchase(models.Model):
    _inherit = 'purchase.order'
   
    purchase_project_name = fields.Many2one('purchase.order', string="List of Purchase order #", required=True, index=True)
    purchase_project_id = fields.Many2one('xxxxx.project', string="Project #")


    and my view:

...
            <notebook colspan="3">
              <page string="Purchase Documents" autofocus="autofocus">
                    <group string="Purchase Order" name="no_purchase_order" priority="1">
                      <field name="project_purchase_order">
                         <tree editable="bottom">
                           <field name="purchase_project_name"/>
                           <field name="purchase_project_id" invisible="1"/>
                         </tree>
                      </field>
                    </group>
              </page>

....

Screenshot:

https://cloudx.rtzevenement.fr/index.php/s/Di4xMgbZTxLc2fj

Avatar
Discard

try to set name field

Best Answer

Hello @jeff,

I think you didn't have managed code for  'project_seq' of 'xxxxx.project' at the time of creation please check once

If you have set, could you please share that code here?


Can you please try this, 

<page string="Purchase Documents" autofocus="autofocus">

  <field name="project_purchase_order">

    <tree editable="bottom">

        <field name="purchase_project_name"/>

        <field name="purchase_project_id" invisible="1"/>

    </tree>

  </field>

</page>

Regards,




Email:     odoo@aktivsoftware.com  

Skype: kalpeshmaheshwari

   

Avatar
Discard
Related Posts Replies Views Activity
0
Nov 22
132
0
Mar 16
2639
0
Mar 15
3006
1
Jan 24
696
1
Oct 23
3983