Odoo Help

Welcome!

This community 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.

0

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

By
oussama
on 12/26/15, 7:31 AM 314 views

Hi 
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:


@api.model
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"/>
</tree>
</field>
</page>
"""
"//page[@string='paiements']"
encais_node = doc.xpath()
feature_page = etree.fromstring(_moves_arch_lst)
if len(encais_node):
encais_node = encais_node[0]
encais_node.addnext(feature_page)
res['arch'] = etree.tostring(doc)
return res

Thanks a lot
 

oussama,
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!

Pawan
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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

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