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

Problem when saving forms of one2many fields.

By
Pau Ubach
on 10/6/14, 4:50 AM 992 views

I have a form A with a field one2many. If I click on a tree element I get the form B.

If I am in B, having A already saved, if I click Save for form B, it gets not saved (not create nor write functions are called) until I click Save on A. 

Any suggestion to can easily save B as soon as I click Save on form B?

 

Thanks

0
Anand Patel
On 10/6/14, 5:20 AM

Hello,

There is a relation between form  a and b like sale and sale order line.

If you have noticed the when we do any changes in the sale order lines then if you save sale order line but not sale order then the saved effect of the sale order line will no saves as they are associated with each other and sale order line is depending on the sale order.

Hope this will help in your case
 

Hi Anand. Yes, I know this is the behavior in OpenERP, I'm trying to find a way to change this, as I'd like to be able to save B (order lines) independently of A (sale).

Pau Ubach
on 10/6/14, 5:23 AM
Okay,

so for that you need to override the write method of sale order line so when you press save button of sale order line then it will be saved that time.

On Mon, Oct 6, 2014 at 2:53 PM, Pau Ubach <pubach@digi-texx.vn> wrote:

Hi Anand. Yes, I know this is the behavior in OpenERP, I'm trying to find a way to change this, as I'd like to be able to save B (order lines) independently of A (sale).

--
Pau Ubach
Sent by OpenERP S.A. using Odoo about Forum Post False



--
Thanks,

Anand Patel
+91 9601663735

Anand Patel
on 10/6/14, 5:50 AM

As stated in my question: "it gets not saved (not create nor write functions are called) until I click Save on A". So overriding write method is not the solution.

Pau Ubach
on 10/6/14, 5:59 AM

By the way, how do you get to skip line.\n Does it accept HTML?  Pau

Pau Ubach
on 10/6/14, 6:08 AM

Pau I'm afraid there is no easy way to do so. The behaviour, as you have noticed, is not controlled by the server side logic, but bythe javascript of the web UI. The code, my suspicion, is controlled somewhere in view_form.js in the web module. But I'm not 100% sure.

Ivan
on 10/6/14, 12:19 PM
You need to call the server methods from the js side on the clicking the save button of sale order line this is the only option to save order lines.

On Mon, Oct 6, 2014 at 9:49 PM, John Doe <niecw@mail.odoo.com> wrote:

Pau I'm afraid there is no easy way to do so. The behaviour, as you have noticed, is not controlled by the server side logic, but bythe javascript of the web UI. The code, my suspicion, is controlled somewhere in view_form.js in the web module. But I'm not 100% sure.

--
John Doe
Sent by Odoo Inc. using Odoo about Forum Post False



--
Thanks,

Anand Patel
+91 9601663735

Anand Patel
on 10/7/14, 2:45 AM

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: 10/6/14, 4:50 AM
Seen: 992 times
Last updated: 3/16/15, 8:10 AM