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

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

By
Yann
on 11/27/14, 7:45 AM 674 views

Hi,

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')))]"/>         
        </record>

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

 

 

 

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