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

onchange method affects different fields

By
Francisco Castro
on 12/9/14, 9:35 AM 814 views

How can I put subtotal result into untaxed result when I changed the item fields?

For example I add a item (100$), subtotal is 100$, so the untaxed amount it will be 100$

and if I change the quantity for two items the amounts change to 200$.

0

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 12/9/14, 10:30 AM

Does it not already do so? Or do you mean literally after every change on the object? If so, you might want to consider calling the "update" button from your on_change methods.

yes its that! I only have to call it like self.button_dummy(self, cr, uid, ids) ?

Francisco Castro
on 12/9/14, 12:24 PM

Should be enough yes. Give it a try.

Ludo - Neobis
on 12/10/14, 10:06 AM
0

deep

--deep--
1617
| 5 4 7
Bengaluru, India
--deep--

Techno-Functional Associate with 6+ years of experience in Odoo (formerly known as OpenERP).

deep
On 12/10/14, 2:48 AM

You can also try this one...

In Order object: write an onchange which takes "order_lines" as parameter... and also in xml view, specify the onchange on the "order_lines" [o2m field]

So now in the onchange method, you can evaluate the lines,

by using orm method "resolve_o2m_commands_to_record_dicts" , which will help you to retrive the values of One2many lines in either case (i.e, saved or unsaved records)

Even I had the same requirement, and this works just perfect....

 

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: 12/9/14, 9:35 AM
Seen: 814 times
Last updated: 3/16/15, 8:10 AM