Overslaan naar inhoud
Menu
Je moet geregistreerd zijn om te kunnen communiceren met de community.
Deze vraag is gerapporteerd
2 Antwoorden
13092 Weergaven

I have a context which get its value from the parent view but sometimes the parent view doesn't has this value so i got error while evaluating the value as it's not find in the context how to figure out if the value defined or not in the context. on XML

context="{'default_opportunity_id': default_opportunity_id}"
Avatar
Annuleer
Beste antwoord

if opportunity_id is your field name try context="{'default_opportunity_id': opportunity_id}"


to fetch from the parent form use context="{'default_opportunity_id': parent.opportunity_id}"

or context="{'default_opportunity_id': parent.opportunity_id and parent.opportunity_id}"


Avatar
Annuleer
Beste antwoord

After reading the article, answer of these questions help you to reflect upon and analyse what you have read.

1- What is context?

2- Why we need context?

3- How to use or define context in Odoo/OpenERP?

<field name="external_evaluation_ids" context="{'default_state':state}">
<tree>
<field name="state"/> <!--newly created field in one2many table-->
<field name="child_table_field1"/>
<field name="child_table_field2"/>
<field name="child_table_field2"/>
</tree>
</field>

Read more about context in details: http://learnopenerp.blogspot.com/2018/01/get-parent-form-value-in-one2many-form.html

Avatar
Annuleer
Gerelateerde posts Antwoorden Weergaven Activiteit
1
mrt. 25
1217
1
jan. 25
1293
0
nov. 24
1441
1
jul. 24
1886
0
jun. 24
1518