Merge lp:~unifield-team/unifield-server/us-982 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 3721
Proposed branch: lp:~unifield-team/unifield-server/us-982
Merge into: lp:unifield-server
Diff against target: 60 lines (+31/-1)
2 files modified
bin/addons/msf_config_locations/stock_configuration.py (+29/-0)
bin/addons/msf_doc_import/check_line.py (+2/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-server/us-982
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+292759@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_config_locations/stock_configuration.py'
2--- bin/addons/msf_config_locations/stock_configuration.py 2015-11-20 10:30:30 +0000
3+++ bin/addons/msf_config_locations/stock_configuration.py 2016-04-25 07:49:49 +0000
4@@ -308,6 +308,35 @@
5 'internal_dest': fields.function(_get_dummy, fnct_search=_dest_int, method=True, string='Internal Picking Dest. Loc.', type='boolean',
6 help='Returns the available locations for destination location of an internal picking according to the product.'),
7 }
8+
9+ def create(self, cr, uid, vals=None, context=None):
10+ """
11+ Remove the whitespaces before and after the name of the location
12+ :param cr: Cursor to the database
13+ :param uid: ID of the res.users that calls this method
14+ :param vals: Values to be put on the new location
15+ :param context: Context of the call
16+ :return: Result of the super() call
17+ """
18+ if vals and vals.get('name'):
19+ vals['name'] = vals.get('name', '').strip()
20+
21+ return super(stock_location, self).create(cr, uid, vals, context=context)
22+
23+ def write(self, cr, uid, ids, vals=None, context=None):
24+ """
25+ Remove the whitespaces before and after the name of the location
26+ :param cr: Cursor to the database
27+ :param uid: ID of the res.users that calls this method
28+ :param ids: List of stock.location ID to be updated
29+ :param vals: Values to be put on the new location
30+ :param context: Context of the call
31+ :return: Result of the super() call
32+ """
33+ if vals and vals.get('name'):
34+ vals['name'] = vals.get('name', '').strip()
35+
36+ return super(stock_location, self).write(cr, uid, ids, vals, context=context)
37
38 stock_location()
39
40
41=== modified file 'bin/addons/msf_doc_import/check_line.py'
42--- bin/addons/msf_doc_import/check_line.py 2016-01-11 14:17:53 +0000
43+++ bin/addons/msf_doc_import/check_line.py 2016-04-25 07:49:49 +0000
44@@ -199,6 +199,7 @@
45 product_id = kwargs.get('product_id')
46 pick_type = kwargs.get('pick_type')
47 pick_subtype = kwargs.get('pick_subtype')
48+ context = kwargs.get('context', {})
49 loc_id = None
50 loc_name = None
51 msg = ''
52@@ -225,7 +226,7 @@
53 pack_loc_id = loc_obj.pool.get('ir.model.data').get_object_reference(cr, uid, 'msf_outgoing', 'stock_location_packing')[1]
54 domain.extend([('id', '=', pack_loc_id)])
55
56- loc_ids = loc_obj.search(cr, uid, domain)
57+ loc_ids = loc_obj.search(cr, uid, domain, context=context)
58 if loc_ids:
59 loc_id = loc_ids[0]
60 elif loc_obj.search(cr, uid, [('name', '=ilike', loc_name)]):

Subscribers

People subscribed via source and target branches

to all changes: