~unifield-team/unifield-wm/trunk

« back to all changes in this revision

Viewing changes to sourcing/sale_order_line.py

  • Committer: jf
  • Date: 2015-03-16 15:45:50 UTC
  • mfrom: (2401.4.4 unifield-wm)
  • Revision ID: jfb@tempo-consulting.fr-20150316154550-onuuurq2cxm7x94n
US-31 [FIX] Problem with OST multiple lines source functionality pop with stock locations
lp:~unifield-team/unifield-wm/us-31

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
    _inherit = 'sale.order.line'
49
49
    _description = 'Sales Order Line'
50
50
 
51
 
    def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
52
 
        if context is None:
53
 
            context = {}
54
 
 
55
 
        '''
56
 
            !!!!! ATTENTION ATTENTION!!!!!!
57
 
            UTP-1021: This solution is NOT stable and could be dangerous!!!!
58
 
            need to have a proper fix for this,
59
 
            currently we have only 3 tree views for sale.order.line
60
 
            so I use the value in the context to identify that it is not the
61
 
            view of wizard, but this assumption could be totally WRONG!
62
 
            But in this current version, it works!
63
 
        '''
64
 
        if not context.get('search_default_need_sourcing', False) and \
65
 
            view_type == 'tree':
66
 
            if '_terp_view_name' in context:
67
 
                '''
68
 
                UFTP-346: HACK ON HACK UTP-1021
69
 
                '_terp_view_name' not set if grouping
70
 
                and we do not want special view when grouping
71
 
                '''
72
 
                view_id = self.pool.get('ir.model.data').get_object_reference(
73
 
                    cr, uid, 'sourcing', 'sourcing_line_special_tree_view')[1]
74
 
        return super(sale_order_line, self).fields_view_get(cr, uid, view_id,
75
 
            view_type, context, toolbar, submenu)
76
 
 
77
51
    """
78
52
    Other methods
79
53
    """