Skip to content

Commit

Permalink
[MERGE] Forward-port 8.0 up to rev. 67a63e2
Browse files Browse the repository at this point in the history
  • Loading branch information
odony committed Feb 3, 2016
2 parents 6562309 + 67a63e2 commit 1f022a0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion addons/stock/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -3680,7 +3680,7 @@ def _handle_renaming(self, cr, uid, warehouse, name, code, context=None):
for pull in route.pull_ids:
pull_obj.write(cr, uid, pull.id, {'name': pull.name.replace(warehouse.name, name, 1)}, context=context)
for push in route.push_ids:
push_obj.write(cr, uid, push.id, {'name': pull.name.replace(warehouse.name, name, 1)}, context=context)
push_obj.write(cr, uid, push.id, {'name': push.name.replace(warehouse.name, name, 1)}, context=context)
#change the mto procurement rule name
if warehouse.mto_pull_id.id:
pull_obj.write(cr, uid, warehouse.mto_pull_id.id, {'name': warehouse.mto_pull_id.name.replace(warehouse.name, name, 1)}, context=context)
Expand Down
2 changes: 1 addition & 1 deletion addons/website_sale/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -993,5 +993,5 @@ def get_unit_price(self, product_ids, add_qty, use_order_pricelist=False, **kw):
pricelist_id = request.session.get('sale_order_code_pricelist_id') or partner.property_product_pricelist.id
else:
pricelist_id = partner.property_product_pricelist.id
prices = pool['product.pricelist'].price_rule_get_multi(cr, uid, [], [(product, add_qty, partner) for product in products], context=context)
prices = pool['product.pricelist'].price_rule_get_multi(cr, uid, [pricelist_id], [(product, add_qty, partner) for product in products], context=context)
return {product_id: prices[product_id][pricelist_id][0] for product_id in product_ids}
8 changes: 6 additions & 2 deletions openerp/tools/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -1170,11 +1170,15 @@ def html_escape(text):

class Pickle(object):
@classmethod
def load(cls, stream):
def load(cls, stream, errors=False):
unpickler = cPickle.Unpickler(stream)
# pickle builtins: str/unicode, int/long, float, bool, tuple, list, dict, None
unpickler.find_global = None
return unpickler.load()
try:
return unpickler.load()
except Exception:
_logger.warning('Failed unpickling data, returning default: %r', errors, exc_info=True)
return errors

@classmethod
def loads(cls, text):
Expand Down

0 comments on commit 1f022a0

Please sign in to comment.