[FIX] point_of_sale: set taxes when creating pos_order from form view

When creating pos_orders from the form view, tax_ids on the
pos_order_lines were never set.

This was kind of fixed in 5327869356. But
in there it was in onchange_qty, because the way the fiscal position was
taken into account required it to be. Because we take the fiscal
position into account in a different way now we can assign the taxes in
onchange_product_id which makes a bit more sense.
This commit is contained in:
Joren Van Onder
2015-09-28 09:00:21 +02:00
parent 358e285fd8
commit f0f45c8fa2
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -1403,6 +1403,10 @@ class pos_order_line(osv.osv):
result = self.onchange_qty(cr, uid, ids, pricelist, product_id, 0.0, qty, price, context=context)
result['value']['price_unit'] = price
prod = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
result['value']['tax_ids'] = prod.taxes_id.ids
return result
def onchange_qty(self, cr, uid, ids, pricelist, product, discount, qty, price_unit, context=None):
@@ -51,6 +51,7 @@
<field name="price_unit" on_change="onchange_qty(parent.pricelist_id,product_id, discount, qty, price_unit, context)" widget="monetary"/>
<field name="price_subtotal" invisible="1" widget="monetary"/>
<field name="price_subtotal_incl" invisible="1" widget="monetary"/>
<field name="tax_ids" widget="many2many_tags"/>
<field name="notice"/>
</group>
</form>