Merge lp:~vauxoo/addons-vauxoo/8.0-stock_location_code-dev-2464-kty into lp:addons-vauxoo

Proposed by Katherine Zaoral (Vauxoo)
Status: Merged
Merged at revision: 894
Proposed branch: lp:~vauxoo/addons-vauxoo/8.0-stock_location_code-dev-2464-kty
Merge into: lp:addons-vauxoo
Diff against target: 32 lines (+5/-4)
1 file modified
stock_location_code/model/stock.py (+5/-4)
To merge this branch: bzr merge lp:~vauxoo/addons-vauxoo/8.0-stock_location_code-dev-2464-kty
Reviewer Review Type Date Requested Status
Katherine Zaoral (Vauxoo) Approve
Moisés López - http://www.vauxoo.com Pending
Review via email: mp+240497@code.launchpad.net

Description of the change

[MERGE] add new functionalities to the stock_location_code module.

To post a comment you must log in.
Revision history for this message
Katherine Zaoral (Vauxoo) (kathy-zaoral) wrote :

LGTM
I will proceed with the merge.

review: Approve
895. By Julio Serna-http://www.vauxoo.com

[IMP] changed domain of function to validated unique code in location

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'stock_location_code/model/stock.py'
2--- stock_location_code/model/stock.py 2014-11-03 19:58:34 +0000
3+++ stock_location_code/model/stock.py 2014-11-05 22:27:57 +0000
4@@ -55,7 +55,8 @@
5 ids = isinstance(ids, (int, long)) and [ids] or ids
6 for location in self.browse(cr, uid, ids, context=context):
7 domain = [('code', '=', location.code),
8- ('company_id', '=', location.company_id.id)]
9+ ('company_id', '=', location.company_id.id),
10+ ('id', '<>', location.id)]
11 repeat_ids = self.search(cr, uid, domain, context=context)
12 if repeat_ids:
13 return False
14@@ -78,15 +79,15 @@
15 ids.update(self.search(cr, user, args + [(
16 'code', operator, name)], limit=limit, context=context))
17 if not limit or len(ids) < limit:
18- # we may underrun the limit because of dupes in the results,
19- # that's fine
20+ # we may underrun the limit because of dupes in the
21+ # results, that's fine
22 ids.update(self.search(
23 cr, user, args + [('name', operator, name)],
24 limit=(limit and (limit-len(ids)) or False),
25 context=context))
26 ids = list(ids)
27 if not ids:
28- ptrn = re.compile('(\[(.*?)\])')
29+ ptrn = re.compile(r'(\[(.*?)\])')
30 res = ptrn.search(name)
31 if res:
32 ids = self.search(