Merge lp:~openbig/bigconsulting/packing_barcode_workflow into lp:bigconsulting

Proposed by gpa(OpenERP)
Status: Superseded
Proposed branch: lp:~openbig/bigconsulting/packing_barcode_workflow
Merge into: lp:bigconsulting
Diff against target: 188 lines (+63/-13)
6 files modified
packing_barcode_check/__terp__.py (+3/-1)
packing_barcode_check/packing_barcode_check.py (+21/-2)
packing_barcode_check/packing_barcode_check_view.xml (+4/-2)
packing_barcode_check/packing_barcode_check_wizard.xml (+1/-8)
packing_barcode_check/packing_barcode_check_workflow.xml (+26/-0)
packing_barcode_check/wizard/scan_product.py (+8/-0)
To merge this branch: bzr merge lp:~openbig/bigconsulting/packing_barcode_workflow
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+32958@code.launchpad.net

This proposal has been superseded by a proposal from 2010-08-18.

Description of the change

Added workflow in the packing_barcode_check

To post a comment you must log in.
79. By gpa(OpenERP)

added changes in workflow of packing_barcode_check

80. By gpa(OpenERP)

changes in the stock_orderpoint_calculator wizard

81. By gpa(OpenERP)

changes in the stock_orderpoint_calculator wizard

82. By gpa(OpenERP)

added new field unscanned quantity in the to_be_scanned view

83. By gpa(OpenERP)

changes in scan product wizard

84. By gpa(OpenERP)

changes in scan product wizard

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'packing_barcode_check/__terp__.py'
2--- packing_barcode_check/__terp__.py 2010-07-26 15:12:49 +0000
3+++ packing_barcode_check/__terp__.py 2010-08-18 07:58:38 +0000
4@@ -31,9 +31,11 @@
5 "license" : "GPL-3",
6 "depends" : ["base","product","stock"],
7 "init_xml" : [],
8- "update_xml" : ["packing_barcode_check_view.xml",
9+ "update_xml" : [
10 "packing_barcode_check_wizard.xml",
11 "packing_barcode_check_report.xml",
12+ "packing_barcode_check_view.xml",
13+ "packing_barcode_check_workflow.xml",
14 ],
15 "active": False,
16 "installable": True
17
18=== modified file 'packing_barcode_check/packing_barcode_check.py'
19--- packing_barcode_check/packing_barcode_check.py 2010-08-17 07:47:09 +0000
20+++ packing_barcode_check/packing_barcode_check.py 2010-08-18 07:58:38 +0000
21@@ -38,16 +38,23 @@
22 'scanned_quantity' : scanned_quantity,
23 'to_be_scanned_quantity' : total_quantity - scanned_quantity,
24 }
25-
26 return res
27
28-
29 _columns = {
30 'total_quantity':fields.function(_compute_quantity, method=True, string='Total Quantity', multi='quantity'),
31 'scanned_quantity': fields.function(_compute_quantity, method=True, string='Scanned Quantity', multi='quantity'),
32 'to_be_scanned_quantity':fields.function(_compute_quantity, method=True, string='Unscanned Quantity', multi='quantity'),
33 'tobe_scan_ids':fields.one2many('tobe.scanned.stock', 'tobe_picking_id', 'To Be'),
34 'scaned_ids':fields.one2many('scanned.stock', 'scanned_picking_id', 'Scanned Picking',),
35+ 'state': fields.selection([
36+ ('draft', 'Draft'),
37+ ('auto', 'Waiting'),
38+ ('confirmed', 'Confirmed'),
39+ ('assigned', 'Available'),
40+ ('scanned', 'Scanned'),
41+ ('done', 'Done'),
42+ ('cancel', 'Cancelled'),
43+ ], 'Status', readonly=True, select=True),
44 }
45 _defaults = {
46 'scanned_quantity' : lambda *a:0.0,
47@@ -58,6 +65,18 @@
48 move_ids = move_obj.search(cr, uid, [('picking_id','=',ids[0])])
49 move_obj.write(cr, uid, move_ids, {'scaned_qty':0.0}, context)
50 return True
51+
52+ def test_scanned(self, cr, uid, ids, context={}):
53+ for pick in self.browse(cr, uid, ids, context=context):
54+ if pick.tobe_scan_ids:
55+ return False
56+ return True
57+
58+ def action_scanned_wkf(self, cr, uid, ids, context={}):
59+ for pick in self.browse(cr, uid, ids, context=context):
60+ if not pick.tobe_scan_ids:
61+ self.write(cr, uid, ids, {'state': 'scanned'})
62+ return True
63
64 stock_picking()
65
66
67=== modified file 'packing_barcode_check/packing_barcode_check_view.xml'
68--- packing_barcode_check/packing_barcode_check_view.xml 2010-08-17 07:26:17 +0000
69+++ packing_barcode_check/packing_barcode_check_view.xml 2010-08-18 07:58:38 +0000
70@@ -38,7 +38,7 @@
71 <field name="backorder_id" select="2" readonly="1"/>
72 <field name="origin" select="2" readonly="1"/>
73 <label string=""/>
74- <button name="button_reset" string="Reset" type="object"/>
75+ <button name="button_reset" states="assigned" string="Reset" type="object"/>
76 </group>
77 <notebook colspan="4">
78 <page string="Scanning Info">
79@@ -66,6 +66,8 @@
80 <button name="draft_validate" states="draft" string="Process Now" type="object"/>
81 <button name="action_assign" states="confirmed" string="Check Availability" type="object"/>
82 <button name="force_assign" states="confirmed" string="Force Availability" type="object"/>
83+ <button name="%(id_scan_product)d" states="assigned" string="Scan Packing" type="action"/>
84+ <button name="%(stock.partial_picking)d" states="scanned" string="Packing Done" type="action"/>
85 <button name="button_cancel" states="assigned,confirmed,draft" string="Cancel"/>
86 </group>
87 </page>
88@@ -108,7 +110,7 @@
89 </field>
90 </record>
91
92- <wizard id="act_selct_picking_open_form" model="stock.picking" name="select.picking" string="Select picking"/>
93+ <wizard id="act_selct_picking_open_form" model="stock.picking" name="select.picking" menu="False" string="Select picking"/>
94 <menuitem action="act_selct_picking_open_form" id="menu_act_selct_picking_open_form" parent="stock.menu_stock_root" type="wizard"/>
95
96 </data>
97
98=== modified file 'packing_barcode_check/packing_barcode_check_wizard.xml'
99--- packing_barcode_check/packing_barcode_check_wizard.xml 2010-07-26 15:12:49 +0000
100+++ packing_barcode_check/packing_barcode_check_wizard.xml 2010-08-18 07:58:38 +0000
101@@ -1,18 +1,11 @@
102 <?xml version="1.0" encoding="utf-8"?>
103 <openerp>
104 <data>
105- <wizard
106- string="Select Picking Wizard"
107- model="stock.picking"
108- name="select.picking"
109- menu="False"
110- id="id_select_picking"/>
111-
112 <wizard
113 string="Scan Product"
114 model="stock.picking"
115 name="scan.product"
116- menu="True"
117+ menu="False"
118 id="id_scan_product"/>
119
120 </data>
121
122=== added file 'packing_barcode_check/packing_barcode_check_workflow.xml'
123--- packing_barcode_check/packing_barcode_check_workflow.xml 1970-01-01 00:00:00 +0000
124+++ packing_barcode_check/packing_barcode_check_workflow.xml 2010-08-18 07:58:38 +0000
125@@ -0,0 +1,26 @@
126+<?xml version="1.0" encoding="utf-8"?>
127+<openerp>
128+ <data>
129+
130+ <record id="act_scanned" model="workflow.activity">
131+ <field name="wkf_id" ref="stock.wkf_picking"/>
132+ <field name="name">scanned</field>
133+ <field name="kind">function</field>
134+ <field name="action">action_scanned_wkf()</field>
135+ </record>
136+
137+ <record id="trans_scanned_move" model="workflow.transition">
138+ <field name="act_from" ref="stock.act_assigned"/>
139+ <field name="act_to" ref="act_scanned"/>
140+ <field name="condition">test_scanned()</field>
141+ <field name="signal">button_scanned</field>
142+ </record>
143+
144+ <record id="stock.trans_scanned_assigned_move" model="workflow.transition">
145+ <field name="act_from" ref="act_scanned"/>
146+ <field name="act_to" ref="stock.act_move"/>
147+ <field name="signal">button_done</field>
148+ </record>
149+
150+ </data>
151+</openerp>
152
153=== modified file 'packing_barcode_check/wizard/scan_product.py'
154--- packing_barcode_check/wizard/scan_product.py 2010-08-13 14:17:17 +0000
155+++ packing_barcode_check/wizard/scan_product.py 2010-08-18 07:58:38 +0000
156@@ -22,6 +22,7 @@
157 import wizard
158 import pooler
159 import time
160+import netsvc
161 from tools.translate import _
162 from osv import osv
163
164@@ -62,10 +63,14 @@
165 _('Unscanned quantity does not match with the product packaging quantity'))
166
167 stock_move_obj.write(cr, uid, [move_id],{'scaned_qty':move_data.scaned_qty+quantity}, context=context)
168+ wkf_service = netsvc.LocalService("workflow")
169+ wkf_service.trg_validate(uid, 'stock.picking', picking_id[0], 'button_scanned', cr)
170+
171 return 'init'
172 else:
173 raise osv.except_osv(_('Warning!'),
174 _('Product does not belongs to this picking or already scanned.'))
175+
176 return {}
177
178 scan_product_lot_form = """<?xml version="1.0"?>
179@@ -103,6 +108,9 @@
180 raise osv.except_osv(_('Warning!'),
181 _('Unscanned quantity does not match with the product packaging quantity'))
182 move_obj.write(cr, uid, [stock_move_obj.id],{'scaned_qty':stock_move_obj.scaned_qty+quantity}, context=context)
183+ wkf_service = netsvc.LocalService("workflow")
184+ wkf_service.trg_validate(uid, 'stock.picking', picking_ids[0], 'button_scanned', cr)
185+
186 call_product_scan = 2
187 if stock_move_obj.product_qty >= stock_move_obj.scaned_qty+1:
188 call_product_scan = 1

Subscribers

People subscribed via source and target branches