diff options
| author | Denis Ledoux <dle@openerp.com> | 2014-04-24 17:16:05 +0200 |
|---|---|---|
| committer | Denis Ledoux <dle@openerp.com> | 2014-04-24 17:16:05 +0200 |
| commit | 3eb4fa3bac87eeaeea446f0a062ee55e19c208c7 (patch) | |
| tree | 2f9935fbb4eeb9b2e5f72850796a22716c49cd49 | |
| parent | e59aecca94a0bdc7e893dcb593feef5baedcaa4b (diff) | |
[FIX] website_sale: taxes must be taken from the product_id_change method
So they are computed with the partner, fiscal_position, etc
bzr revid: dle@openerp.com-20140424151605-81t7v9pc2rou17s3
| -rw-r--r-- | addons/website_sale/models/website.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/addons/website_sale/models/website.py b/addons/website_sale/models/website.py index 14a9a5decff..f5bdf60d881 100644 --- a/addons/website_sale/models/website.py +++ b/addons/website_sale/models/website.py @@ -114,12 +114,11 @@ class Website(orm.Model): product = self.pool.get('product.product').browse(cr, uid, product_id, context=context) values['name'] = "%s: %s" % (product.name, product.variants) if product.variants else product.name - values['tax_id'] = [(6, 0, [tax.id for tax in product.taxes_id])] - if order_line_id: - order_line_obj.write(cr, SUPERUSER_ID, order_line_ids, values, context=context) - else: - order_line_id = order_line_obj.create(cr, SUPERUSER_ID, values, context=context) - order_obj.write(cr, SUPERUSER_ID, [order.id], {'order_line': [(4, order_line_id)]}, context=context) + if values.get('tax_id'): + values['tax_id'] = [(6, 0, values['tax_id'])] + + order_obj.write(cr, SUPERUSER_ID, [order.id], {'order_line': [(1, order_line_id, values) if order_line_id else (0, 0, values)]}, context=context) + elif order_line_ids: order_line_obj.unlink(cr, SUPERUSER_ID, order_line_ids, context=context) |
