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

get and show field value in sale order line

By
Thicham
on 4/17/15, 6:07 AM 643 views

I added a field in the product.template object ( 'remise_max':fields.float("Remise max du prix"), ) and i want it to be shown in the sale order line  next to Quantity, price unit , tax ...once i select a product.

any idea how to make this work the right way !
Thank you

2

Atchuthan - Technical Consultant, Sodexis Inc

--Atchuthan - Technical Consultant, Sodexis Inc--
3883
| 5 3 8
Puducherry, India
--Atchuthan - Technical Consultant, Sodexis Inc--
Passionate coder in Python/Odoo(formerly known as OpenERP).

Contact me via GMail: atchuthantu@gmail.com via Skype: atchuthan_skype
via Linkedin: http://in.linkedin.com/in/atchuthantu
Atchuthan - Technical Consultant, Sodexis Inc
On 4/17/15, 6:36 AM

add a related field in sale.order.line, which will provide the value available in your product

 class sale_order_line(orm.Model):
    _inherit = 'sale.order.line'
    _column = {
        'remise_max': fields.related('product_id'.'remise_max', string='Remise max du prix')
    }

0
Thicham
On 4/17/15, 10:16 AM

Hi Atchuthan and thank you for your help :)

The solution you've proposed is correct but the field remise_max in sale order line get the value just after I click on the save button. what i want is to get that field filled just after selecting the product (product_id) and before click save button!
I hope I make it clear,

ok then, set the value of remise_max using product onchange(product_id_change)

Atchuthan - Technical Consultant, Sodexis Inc
on 4/17/15, 1:03 PM
yes, that's what i did and it works perfectly
Thank you Atchuthan

__________________
Hicham TAROQ
Élève Ingénieur à l'Institut National des Postes et Télécommunications-INPT Rabat



On Fri, Apr 17, 2015 at 6:03 PM, Atchuthan - Technical Consultant, Sodexis Inc <atchuthantu-gmail.com@mail.odoo.com> wrote:

ok then, set the value of remise_max using product onchange(product_id_change)

--
Atchuthan - Technical Consultant, Sodexis Inc
Sent by Odoo Inc. using Odoo access your messages

Thicham
on 4/18/15, 9:32 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

2 follower(s)

Stats

Asked: 4/17/15, 6:07 AM
Seen: 643 times
Last updated: 4/17/15, 10:16 AM