[FIX] website_event_sale: avoid empty writes on product for each registration

The sale.order.line on_change returns related field
values that are not meant to be written on the line.
Removing them from the `values-to-be-written` avoids
the useless write() on product.product and the locking
problems that come with it under high concurrency
environments.
This commit is contained in:
Olivier Dony
2015-05-28 19:04:13 +02:00
parent 5047f4ecad
commit 58f8ffb6a5
@@ -44,6 +44,10 @@ class sale_order(osv.Model):
values['price_unit'] = ticket.price
values['name'] = "%s\n%s" % (ticket.event_id.display_name, ticket.name)
# avoid writing related values that end up locking the product record
values.pop('event_type_id', None)
values.pop('event_ok', None)
return values
def _cart_update(self, cr, uid, ids, product_id=None, line_id=None, add_qty=0, set_qty=0, context=None, **kwargs):