[MERGE] Forward-port of latest saas-2 bugfixes, up to rev. 9154 revid:dle@openerp.com-20140318151824-sscl4m8p87emjl8s
bzr revid: chs@openerp.com-20140318120024-mcxmkncn1xktjs7v bzr revid: dle@openerp.com-20140318152621-l6jxc0bbbofm7fzg
This commit is contained in:
commit
cac0c9600a
|
@ -513,7 +513,7 @@ class pos_order(osv.osv):
|
|||
_description = "Point of Sale"
|
||||
_order = "id desc"
|
||||
|
||||
def create_from_ui(self, cr, uid, orders, context=None):
|
||||
def create_from_ui(self, cr, uid, orders, context=None):
|
||||
|
||||
# Keep only new orders
|
||||
submitted_references = [o['data']['name'] for o in orders]
|
||||
|
|
|
@ -634,10 +634,9 @@ class purchase_order(osv.osv):
|
|||
'name': self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.in'),
|
||||
'origin': order.name + ((order.origin and (':' + order.origin)) or ''),
|
||||
'date': self.date_to_datetime(cr, uid, order.date_order, context),
|
||||
'partner_id': order.dest_address_id.id or order.partner_id.id,
|
||||
'partner_id': order.partner_id.id,
|
||||
'invoice_state': '2binvoiced' if order.invoice_method == 'picking' else 'none',
|
||||
'type': 'in',
|
||||
'partner_id': order.dest_address_id.id or order.partner_id.id,
|
||||
'purchase_id': order.id,
|
||||
'company_id': order.company_id.id,
|
||||
'move_lines' : [],
|
||||
|
|
|
@ -2232,14 +2232,14 @@ class stock_move(osv.osv):
|
|||
if move.picking_id:
|
||||
pickings.add(move.picking_id.id)
|
||||
if move.move_dest_id and move.move_dest_id.state == 'waiting':
|
||||
self.write(cr, uid, [move.move_dest_id.id], {'state': 'confirmed'})
|
||||
self.write(cr, uid, [move.move_dest_id.id], {'state': 'confirmed'}, context=context)
|
||||
if context.get('call_unlink',False) and move.move_dest_id.picking_id:
|
||||
workflow.trg_write(uid, 'stock.picking', move.move_dest_id.picking_id.id, cr)
|
||||
self.write(cr, uid, ids, {'state': 'cancel', 'move_dest_id': False})
|
||||
self.write(cr, uid, ids, {'state': 'cancel', 'move_dest_id': False}, context=context)
|
||||
if not context.get('call_unlink',False):
|
||||
for pick in self.pool.get('stock.picking').browse(cr, uid, list(pickings), context=context):
|
||||
if all(move.state == 'cancel' for move in pick.move_lines):
|
||||
self.pool.get('stock.picking').write(cr, uid, [pick.id], {'state': 'cancel'})
|
||||
self.pool.get('stock.picking').write(cr, uid, [pick.id], {'state': 'cancel'}, context=context)
|
||||
|
||||
for id in ids:
|
||||
workflow.trg_trigger(uid, 'stock.move', id, cr)
|
||||
|
|
Loading…
Reference in New Issue