Odoo Help

1

0
1 Answer
1
Avatar

Mitul Shingala

--Mitul Shingala--

2849
| 6 4 9
Rajkot, الهند
--Mitul Shingala--

Odoo Developer

Mitul Shingala
2‏/5‏/2019 8:35 ص

Hello

you can see the example in "working time".

Activate the debug mode, Go to Settings -> Technical -> Resource -> working time. click on Create button, after that you will get the Working hours by default.

=> using default_get of your main object you can achieve this.

@api.model
def default_get(self, fields_list):
       res = super(classname, self).default_get(fields_list)
       vals = [(0, 0, {'field_1': value_1, 'field_2': value_2}),
               (0, 0, {'field_1': value_1, 'field_2': value_2})]
       res.update({'your_o2m_field': vals})
       return res

I  hope this will helps you.

       


Ask a Question
Writer
Keep Informed
1 follower(s)
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.

Register