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.
As a service company we do not use products and therefore we cannot predefine the tax in order lines which is usually defined by the product. I wrote a simple extension to set the tax on sale order line on creation:
_inherit = 'sale.order.line'
def create(self, cr, uid, values, context=None):
tax = self.pool.get('account.tax').browse(cr, uid, 12, context=context)
values['tax_id'] = [[6, 0, [tax.id]]]
return super(SaleOrderLine, self).create(cr, uid, values, context=context)
My questions are:
1.) How can I obtain the default sales tax from account configuration within the SaleOrderLine extension?
Thanks for your help!
Great! that answers my second question.
But how can I access the default sales tax from account configurations?
Got the answer myself:
ir_values = self.pool.get('ir.values')
taxes_id = ir_values.get_default(cr, uid, 'product.product', 'taxes_id', company_id=company_id)
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: 7/3/15, 3:57 AM|
|Seen: 820 times|
|Last updated: 7/3/15, 5:39 AM|