This question has been flagged
2 Replies
4457 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

Avatar
Discard
Best Answer

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')
    }

Avatar
Discard
Author Best Answer

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,

Avatar
Discard

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

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