~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to product_asset/wizard/stock_partial_move.py

  • Committer: duy.vo at msf
  • Date: 2012-09-18 21:05:00 UTC
  • mfrom: (1175 unifield-wm)
  • mto: This revision was merged to the branch mainline in revision 1188.
  • Revision ID: duy.vo@geneva.msf.org-20120918210500-qw8i815ns8xtk3bv
UF-1055: Merged with trunk 1175

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
class stock_partial_move_memory_out(osv.osv_memory):
28
28
    _inherit = "stock.move.memory.out"
29
29
    
30
 
    def _get_checks_asset(self, cr, uid, ids, name, arg, context=None):
 
30
    def _get_checks_asset(self, cr, uid, ids, fields, arg, context=None):
31
31
        '''
32
32
        complete asset boolean
33
33
        '''
36
36
            result[id] = False
37
37
            
38
38
        for out in self.browse(cr, uid, ids, context=context):
39
 
            result[out.id] = out.product_id.subtype == 'asset'
 
39
            result[out.id] = {}
 
40
            # asset_check
 
41
            asset_check = out.product_id.subtype == 'asset'
 
42
            result[out.id].update({'asset_check': asset_check})
 
43
            # location_supplier_customer_mem_out
 
44
            # source location is supplier or destination location is customer or corresponding picking is type out and subtype picking
 
45
            location_supplier_customer_mem_out = out.move_id.location_id.usage == 'supplier' or out.move_id.location_dest_id.usage == 'customer' or (out.move_id.picking_id and out.move_id.picking_id.type == 'out' and out.move_id.picking_id.subtype == 'picking' and out.move_id.picking_id.state != 'draft')
 
46
            result[out.id].update({'location_supplier_customer_mem_out': location_supplier_customer_mem_out})
40
47
            
41
48
        return result
42
49
    
43
50
    _columns = {
44
51
        'asset_id' : fields.many2one('product.asset', string="Asset"),
45
 
        'asset_check' : fields.function(_get_checks_asset, method=True, string='Asset Check', type='boolean', readonly=True),
 
52
        'asset_check' : fields.function(_get_checks_asset, method=True, string='Asset Check', type='boolean', readonly=True, multi='move_out_multi'),
 
53
        'location_supplier_customer_mem_out' : fields.function(_get_checks_asset, method=True, string='Location Supplier Customer', type='boolean', readonly=True, multi='move_out_multi'),
46
54
    }
47
55
    
48
56
stock_partial_move_memory_out()