Merge lp:~unifield-team/unifield-wm/us-422-453 into lp:unifield-wm

Proposed by jftempo
Status: Needs review
Proposed branch: lp:~unifield-team/unifield-wm/us-422-453
Merge into: lp:unifield-wm
Diff against target: 69 lines (+46/-2)
2 files modified
product_list/product_list.py (+32/-1)
sale_override/sale.py (+14/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-wm/us-422-453
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+267146@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

2573. By Quentin THEURET @Amaris

US-422 [FIX] Bad statement

2572. By Quentin THEURET @Amaris

Merge US-453 :: lp:~unifield-team/unifield-wm/us-453

2571. By Quentin THEURET @Amaris

Merge US-422 :: lp:~unifield-team/unifield-wm/us-422

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'product_list/product_list.py'
--- product_list/product_list.py 2015-04-13 07:16:11 +0000
+++ product_list/product_list.py 2015-08-06 07:06:03 +0000
@@ -273,7 +273,38 @@
273 ('default_code', "unique(default_code)", 'The "Product Code" must be unique'),273 ('default_code', "unique(default_code)", 'The "Product Code" must be unique'),
274 ('xmlid_code', "unique(xmlid_code)", 'The xmlid_code must be unique'),274 ('xmlid_code', "unique(xmlid_code)", 'The xmlid_code must be unique'),
275 ]275 ]
276 276
277 def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
278 """
279 Customize the search() method to include the search of products in a specific list
280 """
281 pl_obj = self.pool.get('product.list')
282 pll_obj = self.pool.get('product.list.line')
283
284 iargs = -1
285 for a in args:
286 iargs += 1
287 if a[0] == 'sublist':
288 prd_domain = set()
289 pl_ids = pl_obj.search(cr, uid, [
290 ('name', a[1], a[2])
291 ], context=context)
292 pll_ids = pll_obj.search(cr, uid, [
293 ('list_id', 'in', pl_ids),
294 ], context=context)
295 for line in pll_obj.browse(cr, uid, pll_ids, context=context):
296 prd_domain.add(line.name.id)
297
298 del args[iargs]
299 args.append(('id', 'in', list(prd_domain)))
300
301 # In case of no list found or no line in lists, empty list
302 if not prd_domain:
303 return []
304
305 return super(product_product, self).search(cr, uid, args, offset, limit, order, context, count)
306
307
277 def write(self, cr, uid, ids, value, context=None):308 def write(self, cr, uid, ids, value, context=None):
278 single = False309 single = False
279 if isinstance(ids, (long, int)):310 if isinstance(ids, (long, int)):
280311
=== modified file 'sale_override/sale.py'
--- sale_override/sale.py 2015-06-03 10:24:22 +0000
+++ sale_override/sale.py 2015-08-06 07:06:03 +0000
@@ -2614,7 +2614,20 @@
2614 '''2614 '''
2615 context = context is None and {} or context2615 context = context is None and {} or context
26162616
2617 if not context.get('noraise') and not context.get('import_in_progress'):2617 if context.get('button') in ['button_remove_lines', 'check_lines_to_fix', 'add_multiple_lines', 'wizard_import_ir_lines']:
2618 return True
2619
2620 btns = [
2621 'button_remove_lines',
2622 'check_lines_to_fix',
2623 'add_multiple_lines',
2624 'wizard_import_ir_lines',
2625 ]
2626 cond1 = context.get('button') not in btns
2627 cond2 = not context.get('noraise')
2628 cond3 = not context.get('import_in_progress')
2629
2630 if cond1 and cond2 and cond3:
2618 empty_lines = False2631 empty_lines = False
2619 if ids and not 'product_uom_qty' in vals:2632 if ids and not 'product_uom_qty' in vals:
2620 empty_lines = self.search(cr, uid, [2633 empty_lines = self.search(cr, uid, [

Subscribers

People subscribed via source and target branches