Skip to Content
Menu
This question has been flagged
2201 Views

I have 2 custom module

1- Setup Customer Site module 

2- Site link Module is generating tree of site module

when i inherit generated tree into sale order it gives error of site_a field not found iam sharing the code 

class sites_link(models.Model):
_name = 'sites.link'
_inherit = ['customer.sites', 'res.partner']
link_ids = fields.One2many('link.link', 'link_id', string='link')

class link_link(models.Model):
_name = 'link.link'
link_id = fields.Many2one('sites.link')
site_a = fields.Many2one('customer.sites','Site A')
site_b = fields.Many2one('customer.sites','Site B')
linkname = fields.Char('Link Name')

<odoo>
<data>
<act_window id="sites_link_action" name="sites_link tree" res_model="sites.link" />
<menuitem id="sites_link_menu" name="sites link" action="sites_link_action" parent="" sequence="5" />
<record id="view_order_form_custom" model="ir.ui.view">
<field name="name">sale.order.form</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<div name="lnk" position="before">
<field name="link_ids" >
<tree editable="bottom">
<field name="site_a"/>
<field name="site_b"/>
<field name="linkname"/>
</tree>
</field>
</div>
</field>
</record>
</data>
</odoo>
Avatar
Discard