~ecommerce-addons-core-editors/e-commerce-addons/github-6.1

« back to all changes in this revision

Viewing changes to base_sale_multichannels/sale.py

  • Committer: Guewen Baconnier
  • Author(s): Sébastien Beau
  • Date: 2013-04-29 08:14:48 UTC
  • mfrom: (281.1.1)
  • Revision ID: git-v1:67db97b1141d9b8175520071de19b57a107df00a
[FIX] fix picking export, indeed if you have an external reference in ir_model_data for an other referential or for the native wizard import/export of openerp, the picking will be not exported

Show diffs side-by-side

added added

removed removed

Lines of Context:
402
402
        LEFT JOIN delivery_carrier
403
403
                  ON delivery_carrier.id = stock_picking.carrier_id
404
404
        WHERE sale_order.shop_id = %(shop_id)s
405
 
              AND ir_model_data.res_id ISNULL
 
405
              AND (
 
406
                  ir_model_data.referential_id is Null
 
407
                  OR ir_model_data.referential_id != %(referential_id)s
 
408
              )
406
409
              AND stock_picking.state = 'done'
407
410
              AND stock_picking.type = 'out'
408
411
              AND NOT stock_picking.do_not_export
415
418
                 stock_picking.backorder_id
416
419
        ORDER BY sale_order.id ASC,
417
420
                 COALESCE(stock_picking.backorder_id, NULL, 0) ASC"""
418
 
        params = {'shop_id': shop.id}
 
421
        params = {'shop_id': shop.id, 'referential_id': shop.referential_id.id}
419
422
        return query, params
420
423
 
421
424
    def export_shipping(self, cr, uid, ids, context):