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
Odoo Training Center
|Asked: 7/3/15, 3:57 AM|
|Seen: 1074 times|
|Last updated: 7/3/15, 5:39 AM|