Skip to Content
Menu
This question has been flagged
1613 Views

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>

Avatar
Discard
Related Posts Replies Views Activity
2
Nov 24
25068
2
May 24
5513
3
Mar 24
4962
0
Mar 24
261
3
Feb 24
11416