콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
2 답글
3143 화면

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

아바타
취소

try to set name field

베스트 답변

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

   

아바타
취소
관련 게시물 답글 화면 활동
0
11월 22
132
0
3월 16
3400
0
3월 15
3816
2
5월 25
2293
1
10월 23
5252