Merge lp:~mallorymarcot/unifield-server/us-4659 into lp:unifield-server

Proposed by jftempo
Status: Merged
Merged at revision: 4961
Proposed branch: lp:~mallorymarcot/unifield-server/us-4659
Merge into: lp:unifield-server
Diff against target: 126 lines (+57/-12)
4 files modified
bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen.py (+1/-0)
bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py (+1/-1)
bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py (+15/-11)
bin/addons/msf_outgoing/wizard/picking_processor.py (+40/-0)
To merge this branch: bzr merge lp:~mallorymarcot/unifield-server/us-4659
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+347606@code.launchpad.net
To post a comment you must log in.
4955. By Mallory MARCOT on 2018-06-08

US-4659 [FIX] issue with BO IN created and pack info

4956. By Mallory MARCOT on 2018-06-08

US-4659 [FIX] issue split line has no pack info

4957. By Mallory MARCOT on 2018-06-11

US-4659 [FIX] IN :: issue with line split in BO

4958. By Mallory MARCOT on 2018-06-11

US-4659 [FIX] PO split line issue with AD (from US-4602)

4959. By Mallory MARCOT on 2018-06-13

US-4659 [FIX] Issue processing IN from scratch

4960. By Mallory MARCOT on 2018-06-13

US-4659 [FIX] Issue processing IN from scratch better way to do

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen.py'
2--- bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen.py 2018-06-06 15:18:03 +0000
3+++ bin/addons/msf_doc_import/wizard/wizard_in_simulation_screen.py 2018-06-13 08:06:55 +0000
4@@ -1715,6 +1715,7 @@
5 'expiry_date': line.imp_exp_date,
6 'line_number': line.line_number,
7 'move_id': move.id,
8+ 'split_move_ok': line.type_change == 'split',
9 'prodlot_id': batch_id,
10 'product_id': line.imp_product_id.id,
11 'uom_id': line.imp_uom_id.id,
12
13=== modified file 'bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py'
14--- bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py 2018-06-07 15:44:40 +0000
15+++ bin/addons/msf_doc_import/wizard/wizard_po_simulation_screen.py 2018-06-13 08:06:55 +0000
16@@ -1671,7 +1671,7 @@
17 'confirmed_delivery_date': line.imp_dcd or False,
18 'esc_confirmed': True if line.imp_dcd else False,
19 })
20- if context.get('auto_import_ok'):
21+ if context.get('auto_import_ok') and line.parent_line_id.po_line_id.analytic_distribution_id:
22 line_vals.update({
23 'analytic_distribution_id': self.pool.get('analytic.distribution').copy(cr, uid, line.parent_line_id.po_line_id.analytic_distribution_id.id, {}, context=context),
24 })
25
26=== modified file 'bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py'
27--- bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py 2018-05-29 13:24:45 +0000
28+++ bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py 2018-06-13 08:06:55 +0000
29@@ -743,16 +743,13 @@
30 total_length = 0.0
31 total_width = 0.0
32 for move in self.pool.get('stock.move.in.processor').browse(cr, uid, move_ids, context=context):
33- total_weight += move.weight
34- total_height += move.height
35- total_length += move.length
36- total_width += move.width
37- family_data.update({
38- 'weight': total_weight,
39- 'height': total_height,
40- 'length': total_length,
41- 'width': total_width,
42- })
43+ family_data.update({
44+ 'weight': move.weight,
45+ 'height': move.height,
46+ 'length': move.length,
47+ 'width': move.width,
48+ })
49+ break
50
51 fam_id = self.pool.get('in.family.processor').create(cr, uid, family_data, context=context)
52 if move_ids:
53@@ -1197,7 +1194,14 @@
54 'width': fields.float('Width', digits=(16,2)),
55 'pack_id': fields.many2one('in.family.processor', string='Pack', ondelete='set null'),
56 'sequence_issue': fields.selection(INTEGRITY_STATUS_SELECTION, 'Sequence issue', readonly=True),
57- }
58+ 'split_move_ok': fields.boolean(string='Is split move ?'),
59+ }
60+
61+
62+ _defaults = {
63+ 'split_move_ok': lambda *a: False,
64+ }
65+
66
67 """
68 Model methods
69
70=== modified file 'bin/addons/msf_outgoing/wizard/picking_processor.py'
71--- bin/addons/msf_outgoing/wizard/picking_processor.py 2018-05-22 12:37:31 +0000
72+++ bin/addons/msf_outgoing/wizard/picking_processor.py 2018-06-13 08:06:55 +0000
73@@ -212,6 +212,43 @@
74 if line_obj._name == 'stock.move.in.processor':
75 # search for simulation done for this move, and if has pack info attached
76 sm_in_proc = line_obj.search(cr, uid, [('move_id', '=', move.id)], order='id desc', context=context)
77+
78+ link_data = {}
79+ if not sm_in_proc:
80+ # search stock.incoming.processor for the move.picking_id
81+ if move.purchase_line_id.id:
82+ stock_move_ids = self.pool.get('stock.move').search(cr, uid, [('purchase_line_id', '=', move.purchase_line_id.id)], context=context)
83+ picking_ids = [data['picking_id'][0] for data in self.pool.get('stock.move').read(cr, uid, stock_move_ids, ['picking_id']) if data['picking_id']]
84+ picking_ids = list(set(picking_ids))
85+
86+ for in_proc_id in self.pool.get('stock.incoming.processor').search(cr, uid, [('picking_id', 'in', picking_ids)], order='id desc', context=context):
87+ # search for stock.move.in.processor with same wizard_id and line_number and with split_move_ok flag on
88+ sm_in_proc = line_obj.search(cr, uid, [
89+ ('wizard_id', '=', in_proc_id),
90+ ('line_number', '=', move.line_number),
91+ ('split_move_ok', '=', False),
92+ ('pack_info_id', '!=', False),
93+ ], order='id asc', context=context)
94+ if sm_in_proc and context.get('picking_type') == 'incoming_shipment':
95+ link_data = {'move_id': move.id}
96+ break
97+
98+ if not sm_in_proc and context.get('picking_type') == 'incoming_shipment' and move.picking_id and move.picking_id.origin:
99+ # search backorder
100+ picking_ids = self.pool.get('stock.picking').search(cr, uid, [('origin', '=', move.picking_id.origin), ('id', '!=', move.picking_id.id)])
101+
102+ for in_proc_id in self.pool.get('stock.incoming.processor').search(cr, uid, [('picking_id', 'in', picking_ids)], order='id desc', context=context):
103+ # search for stock.move.in.processor with same wizard_id and line_number and with split_move_ok flag on
104+ sm_in_proc = line_obj.search(cr, uid, [
105+ ('wizard_id', '=', in_proc_id),
106+ ('line_number', '=', move.line_number),
107+ ('split_move_ok', '=', False),
108+ ('pack_info_id', '!=', False),
109+ ], order='id asc', context=context)
110+ if sm_in_proc and context.get('picking_type') == 'incoming_shipment':
111+ link_data = {'move_id': move.id}
112+ break
113+
114 for sm_in_proc in line_obj.browse(cr, uid, sm_in_proc, context=context):
115 if sm_in_proc.pack_info_id:
116 line_data.update({
117@@ -222,7 +259,10 @@
118 'height': sm_in_proc.pack_info_id.total_height,
119 'length': sm_in_proc.pack_info_id.total_length,
120 'width': sm_in_proc.pack_info_id.total_width,
121+ 'cost': sm_in_proc.cost,
122 })
123+ if link_data:
124+ line_obj.write(cr, uid, [sm_in_proc.id], link_data, context=context)
125 break
126 line_obj.create(cr, uid, line_data, context=context)
127

Subscribers

People subscribed via source and target branches