Odoo Help


how to fetch the value of my current fields as my default value when creating new records?.

on 11/5/14, 11:01 AM 1,097 views

Hi all,

how to fetch the value of my current fields as my default value when creating new records.

let say in my product model i have existing value of my fields which is field1 = 5 and field2 = 10 period Jan 1- 7, 2014.

what I want to achieve is on the next period dated Jan 8 - 14, 2014 or the next enter of the new inventory record for product1 else product2. I want to fetch previous value of field1 and field2 as the default value of my new field1 and field2.

currently i have custom product and inventory modules and 2 reserve fields in inventory module but Im stuck. I dont know how to implement. is very complicated because that 2 fields always been change, my Idea is to update that fields but I think I cant go back to my previous reports after created the new inventory records for the specific product because the value is changed. 

anybody here who can give Idea on how to do it and best way to implement this?.

This for custom weekly period monitoring inventory to my custom product

Thanks for reading

any suggestion here?

on 11/6/14, 5:22 AM

hello world, any updates here?

on 11/13/14, 8:24 AM

Hi odoo community please help me, need your help to figure it out what has to be done this?

on 11/13/14, 8:10 PM



| 6 8 7
Bangalore, India
On 11/13/14, 10:41 PM

Hi Philip , while creating the record for the period jan 8 -14 2014 for a specific product , you can check whether there is any record has been created previously for the product.

If created then you can get the value from that record order by date descending and get the values for field 1 and field2 from that record else the value for field 1 and field 2 will be empty in case this is a new record for the product


Let us take the example of Class A

1) In create method, check the class if already any record exists order by id or not

2) if records exists, then browse the value from searched record and update it to your newly creating record.

3) if record does not exist, then you can give your own values to the fields.

Is this Clear

could you please give an simple example, I am new in odoo7 thanks for the response

on 11/13/14, 11:10 PM

sir can I have your personal email address

on 11/13/14, 11:11 PM

Sir I am very thankful if you give a simple understandable code sample or working code. thanks for your kind

on 11/13/14, 11:17 PM

update please

on 11/14/14, 11:55 AM

Updated the answer

on 11/16/14, 11:37 PM

yes clear very, if you could give us simple working code much better, other also can benefit. Thanks

on 11/17/14, 12:55 AM

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/5/14, 11:01 AM
Seen: 1097 times
Last updated: 3/16/15, 8:10 AM