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

Proposed by jftempo
Status: Merged
Merged at revision: 4114
Proposed branch: lp:~mallorymarcot/unifield-server/us-1804
Merge into: lp:unifield-server
Diff against target: 60 lines (+16/-9)
2 files modified
bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py (+14/-5)
bin/addons/order_types/stock.py (+2/-4)
To merge this branch: bzr merge lp:~mallorymarcot/unifield-server/us-1804
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+313315@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jeff Allen (jr.allen) :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py'
2--- bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py 2016-11-09 09:07:38 +0000
3+++ bin/addons/msf_outgoing/wizard/incoming_shipment_processor.py 2016-12-15 08:31:58 +0000
4@@ -155,10 +155,6 @@
5 'return to IN form view and re-try.'),
6 )
7
8- self.write(cr, uid, [proc.id], {
9- 'already_processed': True,
10- }, context=context)
11-
12 for line in proc.move_ids:
13 # If one line as an error, return to wizard
14 if line.integrity_status != 'empty':
15@@ -172,6 +168,10 @@
16 'context': context,
17 }
18
19+ self.write(cr, uid, [proc.id], {
20+ 'already_processed': True,
21+ }, context=context)
22+
23 for line in proc.move_ids:
24 # if no quantity, don't process the move
25 if not line.quantity:
26@@ -318,7 +318,16 @@
27 _('Processing Error'),
28 _('No data to process !'),
29 )
30- incoming_obj.write(cr, uid, ids, {'draft': True}, context=context)
31+
32+ # make sure that the current incoming proc is not already processed :
33+ for r in incoming_obj.read(cr, uid, ids, ['already_processed']):
34+ if not r['already_processed']:
35+ incoming_obj.write(cr, uid, ids, {'draft': True}, context=context)
36+ else:
37+ raise osv.except_osv(
38+ _('Error'), _('The incoming shipment as already been processed, you can not save it as draft.')
39+ )
40+
41 return {}
42
43 def force_process(self, cr, uid, ids, context=None):
44
45=== modified file 'bin/addons/order_types/stock.py'
46--- bin/addons/order_types/stock.py 2016-05-17 12:12:38 +0000
47+++ bin/addons/order_types/stock.py 2016-12-15 08:31:58 +0000
48@@ -326,10 +326,8 @@
49
50 # US-148
51 if pick.type == 'in':
52- args = [('picking_id', '=', pick.id),
53- ('draft', '=', True)]
54- wiz_ids = wizard_obj.search(cr, uid, args=args,
55- context=context)
56+ domain = [('picking_id', '=', pick.id), ('draft', '=', True), ('already_processed', '=', False)]
57+ wiz_ids = wizard_obj.search(cr, uid, domain, context=context)
58 if wiz_ids:
59 proc_id = wiz_ids[0]
60 else:

Subscribers

People subscribed via source and target branches