diff options
| author | Joren Van Onder <jov@odoo.com> | 2015-09-25 15:55:21 +0200 |
|---|---|---|
| committer | Joren Van Onder <jov@odoo.com> | 2015-09-28 09:00:21 +0200 |
| commit | f0f45c8fa2e9069f25b202e57774d3f4d44b1d2a (patch) | |
| tree | 7370320090204994eae31fc19171be16dd5fdbe6 | |
| parent | 358e285fd8ed75ac322213bd1d3382ff7fc28eba (diff) | |
[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 5327869356ca629728ef45ebdef2598c1d02dd4b. 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.
| -rw-r--r-- | addons/point_of_sale/point_of_sale.py | 4 | ||||
| -rw-r--r-- | addons/point_of_sale/point_of_sale_view.xml | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 11f554eea1e..c587e259543 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -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): diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 8db659c0678..cea736d597a 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -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> |
