Skip to Content
Menu
This question has been flagged
1 Reply
2361 Views

I'm customizing Odoo 8.0 to support sale of Real Estate properties by each property's Gross internal Area (GIA) in square metres. I have created a custom model extending the product.template model with the following field 

'qty_gia': fields.integer('Floor Space', help="Gross internal area of property")

How do I create a function that will set the qty_gia value as the default product_uos_qty and quantity values in the sale_order_line and account.invoice.line models respectively?

Avatar
Discard
Best Answer

I think you can write onchange method on sale_order_line and account_invoice_line. so, while creating sale_order_line or account_invoice_line product_uos_qty will auto-populate form product screen.

def onchange_product(self)

    for line in self:

        line.product_uos_qty=line.product_id.qty_gia

This code is for your reference. it may not be directly work.


Hope this help.

Avatar
Discard