Skip to Content
Menu
This question has been flagged
2057 Views

I make relation between Purchase Order Line and Request Order Line

The relation is manytomany

How I done that via

Code .py

class MaterialRequestRelated(models.Model):

   _inherit = 'purchase.order'

request_id = fields.Many2many('purchase.request.line',string='Request  Order')

view .xml

 <record id="purchase.purchase_order_form_inhirit"  model="ir.ui.view">

<field name="name">purchase.order.form</field>

<field name="model">purchase.order</field>

<field name="inherit_id" ref="purchase.purchase_order_form"/>

 

<field name="arch" type="xml"

<xpath expr="/form/sheet/notebook" position="inside"


<page name="Material_Request" string="Material Request"

<field name="request_id"/

<field name="id"/

                        </page>   </xpath>    </field>   </record

Now I want to make tree view to show the table but when I create the view its showing the relation table

Via the code

 fff

<record id="purchase_request_line_Tree" model="ir.ui.view">

<field name="name">purchase.order.MaterialRequestRelated.tree</field>

<field name="model">purchase.order</field

<field name="arch" type="xml"

<tree>

   <field name="id"/>

       </tree>

</field>

</record>

 

My question is how can I show the two table they have the relation not the relation table it show 

Avatar
Discard
Related Posts Replies Views Activity
2
Nov 24
25101
2
May 24
5524
3
Mar 24
4967
0
Mar 24
264
3
Feb 24
11421