This question has been flagged
1 Reply
5826 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

Avatar
Discard
Best Answer

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
 

Avatar
Discard
Author

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).

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

Author

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.

Author

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

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.

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