Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
3138 Weergaven

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
Annuleer

try to set name field

Beste antwoord

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
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
0
nov. 22
132
0
mrt. 16
3399
0
mrt. 15
3815
2
mei 25
2288
1
okt. 23
5249