diff --git a/addons/product/pricelist.py b/addons/product/pricelist.py index 6899b673c70..cf4d129b666 100644 --- a/addons/product/pricelist.py +++ b/addons/product/pricelist.py @@ -264,7 +264,7 @@ class product_pricelist(osv.osv): product_obj.price_get(cr, uid, [product_id], price_type.field)[product_id], round=False, context=context) - if price: + if price >= 0.0: price_limit = price price = price * (1.0+(res['price_discount'] or 0.0)) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index c942818a3d4..f0d6ca83b32 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1886,6 +1886,14 @@ class stock_move(osv.osv): @return: True """ self.write(cr, uid, ids, {'state': 'confirmed'}) + + # fix for bug lp:707031 + # called write of related picking because changing move availability does + # not trigger workflow of picking in order to change the state of picking + wf_service = netsvc.LocalService('workflow') + for move in self.browse(cr, uid, ids, context): + if move.picking_id: + wf_service.trg_write(uid, 'stock.picking', move.picking_id.id, cr) return True # diff --git a/addons/stock/wizard/stock_invoice_onshipping.py b/addons/stock/wizard/stock_invoice_onshipping.py index c7eab1eef4d..37b3d09810f 100644 --- a/addons/stock/wizard/stock_invoice_onshipping.py +++ b/addons/stock/wizard/stock_invoice_onshipping.py @@ -127,7 +127,7 @@ class stock_invoice_onshipping(osv.osv_memory): res = picking_pool.action_invoice_create(cr, uid, active_ids, journal_id = onshipdata_obj[0]['journal_id'], group = onshipdata_obj[0]['group'], - type = None, + type = context.get('inv_type'), context=context) return res