Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
i created a function field tax_amount in sale_order_line. Now i want to call my function field from existing onchange function of product uom in sale order line. How to call a function field function from onchange function and give me example
Simply i want to compute a sale order amounts(amount_untaxed, amount_tax, amount_total) for each sale order line entries. Can be a solution or idea to achieve this
Hope you are working with v8. I don't think, you need to override the onchange function.
If your tax_amount depends only on product uom, you can define the tax_amount as a compute field which depends on product_uom. onchange is default in compute fields. If tax_amount depends on more fields, you can include that also. For eg:
_inherit = 'sale.order.line'
tax_amount = fields.Float(compute='_get_tax_amount', string='Tax Amount')
//Your code here that calculates the tax value
self.tax_amount = tax value
About This Community
This platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 6/26/14, 7:36 AM|
|Seen: 2795 times|
|Last updated: 10/12/15, 10:49 PM|