Odoo Help


Error: Field 'encais_autrui_ids' specified in view could not be found.

on 12/26/15, 7:31 AM 354 views

I get this error

Error: Field 'encais_autrui_ids' specified in view could not be found.

when i use fields_view_get to create a new field in the view.

This is the code:

def fields_view_get(self, view_id=None, view_type='form', toolbar=FalseFalse, submenu=):
res = super(MultiplePayment, self).fields_view_get(
view_idview_typetoolbarsubmenu=view_id, =view_type, =toolbar, =submenu)
if self._context.get('type'):
doc = etree.fromstring(res['arch'])
invoice_id = self._context.get('active_id', False)
encais_doc = self.env['account.invoice.encais_doc''invoice_patient_id''='].search([(, , invoice_id)])
for in record encais_doc:
_moves_arch_lst = """
<page string='"""
+ record.doc_id.name + \
' (' + strround((record.balance, 3)) + ' TND)' """'>
<field name="encais_autrui_ids" context="{'default_doc_id':"""
+ + \
str(record.doc_id.id) + """ ,'default_invoice_id':invoice_id}">
<tree editable="bottom">
<field name="journal_id"/>
<field name="doc_id" invisible="1"/>
<field name="bank_id"/>
<field name="invoice_id" invisible="1"/>
<field name="is_onchange" invisible="1"/>
<field name="cheque"/>
<field name="amount"/>
encais_node = doc.xpath()
feature_page = etree.fromstring(_moves_arch_lst)
if len(encais_node):
encais_node = encais_node[0]
res['arch'] = etree.tostring(doc)
return res

Thanks a lot

Is 'encais_autrui_ids' field is defined at the time of object creation?
If not then, you can not create/append any new field i this way, as fields already defined in the object can only be rendered by the odoo in tag
hope it helps!

on 12/29/15, 9:11 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

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

1 follower(s)


Asked: 12/26/15, 7:31 AM
Seen: 354 times
Last updated: 12/26/15, 7:47 AM