Odoo Help


V7 : many2one and one2many

on 1/9/14, 4:24 AM 2,218 views

Im trying to add new grid structure in Purchase module under POLine.

I have added 2 fields in POLine

'line_id':fields.one2many('POSub.line','sub_id','Sub Line'),

Added the new class structure for POSubLine in purchase.py

class POSub_line(osv.osv):
_name = 'POSub.line'        
_columns = {
            'S_no':fields.char('Serial Number',size=64,required=True,readonly=True),
            'other_cost':fielsds.float('Other Cost'),                
            'sub_id':fields.many2one('purchase.order','Serial No',ondelete='cascade'),
            'tag_no':fields.char('Tag No'),           


<field name="product_id1">
<field name="line_ids1" >                           
<tree string="PO Sub Line" editable="bottom">
<field name="product_id"/>
<field name="s_no"/>
<field name="tag_no" /> 
<field name="unit_price" />     

when Updating the module getting the error:

 openerp.osv.orm: Can't find field 'line_ids1' in the following view parts composing the view of object model 'purchase.order':
  * purchase.order.form
  Either you wrongly customized this view, or some modules bringing those views are not compatible with your current data model
  openerp.addons.base.ir.ir_ui_view: Can't render view purchase.purchase_order_form for model: purchase.order
  Error occurred while validating the field(s) arch: Invalid XML for View Architecture!')

How do i resolve?

Comment the field tag_no in xml, then restart the server, then uncomment and upgrade the module.

Gopakumar N G
on 1/9/14, 4:54 AM

Error Exist: Can't find field 'line_ids1'

on 1/9/14, 5:47 AM
Sylvain LE GAL
On 1/10/14, 5:03 PM


In the python model :

'line_id':fields.one2many('POSub.line','sub_id','Sub Line'),

In the view :

<field name="line_ids1" >

line_ids1 is not defined...

'line_ids':fields.one2many('POSub.line','sub_id','Sub Line'),

<field name="line_ids" >

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 1/9/14, 4:24 AM
Seen: 2218 times
Last updated: 3/16/15, 8:10 AM