I'm new to Odoo and I'm on this project that's beyond my skills.There are many templates: (I show only two.)
<record id="showcase_1" model="ir.ui.view">
<field name="number_of_areas">1</field>
</record>
<record id="showcase_2_1" model="ir.ui.view">
<field name="number_of_areas">2</field>
</record> .
How do I fetch the value of the field!?
new_signage = request.env['signage.signage'].create({ 'name': title , 'template_id': request.env['ir.ui.view'].search([('key','=', post.get('default_layout')[0])]) })
****
Working code:
if len(template_id) > 0:
template_id = template_id[0].id
else:
template_id = None new_signage = request.env['signage.signage'].create({
'name': title ,
'template_id': template_id,
})
****
Next, how do I fetch the value within the ...field "number_of_areas"?.
<record id="signage.showcase_1" model="ir.ui.view">
<field name="number_of_areas">1</field>
</record>