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.

2

override one2many field save method

By
Eric
on 3/19/14, 5:52 PM 1,565 views

Hello, I need to override the one2many field save method for the sale_order. Does anyone know how to do that?

I created an inherited view of the sale_order_line form, and added a "support" selection field to it. If a user selects one of the options from the selection field, then it should create 2 sale_order_lines when the red Save & Close button is clicked.

Right now, it just adds 1 line to the one2many list by caching the data in the web browser. Then the record is created on the sale_order_line table when the red Save button is clicked on the sale_order form.

So I would like to override the save method on the sale_order_line form so that I can add a second line if i need to.

sale_order_line view:

image description

This is what I would like to see on the sale_order form. The two lines added to the list once I click on the Save & Close button from the inherited sale_order_line view

sale_order view

image description

but Im only getting the one line item instead

image description

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

0 follower(s)

Stats

Asked: 3/19/14, 5:52 PM
Seen: 1565 times
Last updated: 9/20/16, 10:15 AM