Odoo Help


time.strftime() as value for a search domain ?

on 11/27/14, 7:45 AM 1,105 views


I want to create a record in ir.model.data for a created period. The "code" of the period depends on the current year so i try this code :

<record model="ir.model.data" id="fiscalyear_test">
        <field name="name" eval="str(time.strftime('%Y'))" />        
        <field name="module">account</field>
        <field name="model">account.fiscalyear</field>
        <field name="res_id" model="account.fiscalyear" search="[('code', '=',str(time.strftime('%Y')))]"/>         

The search parameter seems not to accept this type of value. Could you help me please ?




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: 11/27/14, 7:45 AM
Seen: 1105 times
Last updated: 3/16/15, 8:10 AM