Odoo Help

4

0
16 Answers
4
Avatar

Sudhir Arya (ERP Harbor Consulting Services) India

--Sudhir Arya (ERP Harbor Consulting Services)--
26747
| 8 9 10
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 

LinkedIn

Blog

Stackoverflow

ERP Harbor Consulting Services

Skype:sudhir@erpharbor.com
Website: http://www.erpharbor.com
Sudhir Arya (ERP Harbor Consulting Services) India
3/29/13, 7:58 AM

I don't have any idea about web but I can give you another solution that you can override create or write method.

create method will be called when you will create a record and write will be called when you will update the record.

def create(cr, uid, vals, context=None):
    #Todo code
    super(your_class_name, self).create(cr, uid, vals, context=context)

def write(cr, uid, ids, vals, context=None):
    #Todo code
    super(your_class_name, self).write(cr, uid, ids, vals, context=context)

Hope it will work for you.

Thanks.

5 Comments
yellow France
3/29/13, 8:06 AM

Thanks for your answer, I know it is possible to overwrite method write, create, unlink ..., but the problem in a one2many wizard is that when you created a new line and saved this line with button in wizard, tehre is no create or write action, due to the code in web client, there is just a temporary id created prefixed as one2many_v_id_xxx (see file data.js in web), changes are really saved only when I push button save of the form, and not when I push button save of the wizard, then in this case operations I want to do can not be done immediately. An other idea ??? Thanks

Sudhir Arya (ERP Harbor Consulting Services) India
3/29/13, 8:11 AM

Did you try on_change on your one2many field?

yellow France
3/29/13, 8:16 AM

Thanks for your effort and answer, the same conclusion as Francesco, but it was the first to find, I will validate his answer, but I vote for your answer too. Thanks. Bye

Sudhir Arya (ERP Harbor Consulting Services) India
3/29/13, 8:19 AM

My pleasure. If you get solution then please share it so that it can help to others.

yellow France
3/29/13, 8:31 AM

If I find an other solution I will share it. Thanks again bye.

1
Avatar

Francesco OpenCode Italy

--Francesco OpenCode--

3949
| 7 8 11
Grottaglie, Italy
--Francesco OpenCode--

Italian Odoo Developer. Python lover. Beer addicted.

LINKEDIN: http://www.linkedin.com/in/francescoapruzzese

Francesco OpenCode Italy
3/29/13, 7:58 AM

The best way is to do a super on write and/or create function in your class.

Another way is to use the on_change function on the one2many field so you can do all the control you need

6 Comments
yellow France
3/29/13, 8:06 AM

Thanks for your answer, I know it is possible to overwrite method write, create, unlink ..., but the problem in a one2many wizard is that when you created a new line and saved this line with button in wizard, tehre is no create or write action, due to the code in web client, there is just a temporary id created prefixed as one2many_v_id_xxx (see file data.js in web), changes are really saved only when I push button save of the form, and not when I push button save of the wizard, then in this case operations I want to do can not be done immediately. An other idea ??? Thanks

Francesco OpenCode Italy
3/29/13, 8:10 AM

You can use the on_change function to do something when you o2m change

yellow France
3/29/13, 8:14 AM

Effectively, this is the conclusion I found too. Update your answer with good conclusion, I will valid it. Thanks. Bye

Francesco OpenCode Italy
3/29/13, 8:27 AM

done....:)

yellow France
3/29/13, 8:31 AM

Done too, thanks again, bye.

yellow France
4/13/13, 10:28 AM

Hi, I reopen question because onchange doesn't work, I have an error with virtual id .... an other idea ? thanks. Bye

0
Sandro Mozambique
4/12/17, 5:45 PM

Hi all, any update about this issue????

Thanks in advance.

Ask a Question
Writer
Keep Informed
0 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
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now