Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
2 Replies
3148 Tampilan

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
Buang

try to set name field

Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
0
Nov 22
132
0
Mar 16
3404
0
Mar 15
3818
2
Mei 25
2295
1
Okt 23
5255