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