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
=== modified file 'packing_barcode_check/__terp__.py'
--- packing_barcode_check/__terp__.py 2010-07-26 15:12:49 +0000
+++ packing_barcode_check/__terp__.py 2010-08-18 07:58:38 +0000
@@ -31,9 +31,11 @@
31 "license" : "GPL-3",31 "license" : "GPL-3",
32 "depends" : ["base","product","stock"],32 "depends" : ["base","product","stock"],
33 "init_xml" : [],33 "init_xml" : [],
34 "update_xml" : ["packing_barcode_check_view.xml",34 "update_xml" : [
35 "packing_barcode_check_wizard.xml",35 "packing_barcode_check_wizard.xml",
36 "packing_barcode_check_report.xml",36 "packing_barcode_check_report.xml",
37 "packing_barcode_check_view.xml",
38 "packing_barcode_check_workflow.xml",
37 ],39 ],
38 "active": False,40 "active": False,
39 "installable": True41 "installable": True
4042
=== modified file 'packing_barcode_check/packing_barcode_check.py'
--- packing_barcode_check/packing_barcode_check.py 2010-08-17 07:47:09 +0000
+++ packing_barcode_check/packing_barcode_check.py 2010-08-18 07:58:38 +0000
@@ -38,16 +38,23 @@
38 'scanned_quantity' : scanned_quantity,38 'scanned_quantity' : scanned_quantity,
39 'to_be_scanned_quantity' : total_quantity - scanned_quantity,39 'to_be_scanned_quantity' : total_quantity - scanned_quantity,
40 }40 }
41
42 return res41 return res
4342
44
45 _columns = {43 _columns = {
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'),
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'),
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'),
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'),
50 'scaned_ids':fields.one2many('scanned.stock', 'scanned_picking_id', 'Scanned Picking',),48 'scaned_ids':fields.one2many('scanned.stock', 'scanned_picking_id', 'Scanned Picking',),
49 'state': fields.selection([
50 ('draft', 'Draft'),
51 ('auto', 'Waiting'),
52 ('confirmed', 'Confirmed'),
53 ('assigned', 'Available'),
54 ('scanned', 'Scanned'),
55 ('done', 'Done'),
56 ('cancel', 'Cancelled'),
57 ], 'Status', readonly=True, select=True),
51 }58 }
52 _defaults = {59 _defaults = {
53 'scanned_quantity' : lambda *a:0.0,60 'scanned_quantity' : lambda *a:0.0,
@@ -58,6 +65,18 @@
58 move_ids = move_obj.search(cr, uid, [('picking_id','=',ids[0])])65 move_ids = move_obj.search(cr, uid, [('picking_id','=',ids[0])])
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)
60 return True67 return True
68
69 def test_scanned(self, cr, uid, ids, context={}):
70 for pick in self.browse(cr, uid, ids, context=context):
71 if pick.tobe_scan_ids:
72 return False
73 return True
74
75 def action_scanned_wkf(self, cr, uid, ids, context={}):
76 for pick in self.browse(cr, uid, ids, context=context):
77 if not pick.tobe_scan_ids:
78 self.write(cr, uid, ids, {'state': 'scanned'})
79 return True
6180
62stock_picking()81stock_picking()
6382
6483
=== modified file 'packing_barcode_check/packing_barcode_check_view.xml'
--- packing_barcode_check/packing_barcode_check_view.xml 2010-08-17 07:26:17 +0000
+++ packing_barcode_check/packing_barcode_check_view.xml 2010-08-18 07:58:38 +0000
@@ -38,7 +38,7 @@
38 <field name="backorder_id" select="2" readonly="1"/>38 <field name="backorder_id" select="2" readonly="1"/>
39 <field name="origin" select="2" readonly="1"/>39 <field name="origin" select="2" readonly="1"/>
40 <label string=""/>40 <label string=""/>
41 <button name="button_reset" string="Reset" type="object"/>41 <button name="button_reset" states="assigned" string="Reset" type="object"/>
42 </group>42 </group>
43 <notebook colspan="4">43 <notebook colspan="4">
44 <page string="Scanning Info">44 <page string="Scanning Info">
@@ -66,6 +66,8 @@
66 <button name="draft_validate" states="draft" string="Process Now" type="object"/>66 <button name="draft_validate" states="draft" string="Process Now" type="object"/>
67 <button name="action_assign" states="confirmed" string="Check Availability" type="object"/>67 <button name="action_assign" states="confirmed" string="Check Availability" type="object"/>
68 <button name="force_assign" states="confirmed" string="Force Availability" type="object"/>68 <button name="force_assign" states="confirmed" string="Force Availability" type="object"/>
69 <button name="%(id_scan_product)d" states="assigned" string="Scan Packing" type="action"/>
70 <button name="%(stock.partial_picking)d" states="scanned" string="Packing Done" type="action"/>
69 <button name="button_cancel" states="assigned,confirmed,draft" string="Cancel"/>71 <button name="button_cancel" states="assigned,confirmed,draft" string="Cancel"/>
70 </group>72 </group>
71 </page> 73 </page>
@@ -108,7 +110,7 @@
108 </field>110 </field>
109 </record>111 </record>
110112
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"/>
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"/>
113115
114 </data>116 </data>
115117
=== modified file 'packing_barcode_check/packing_barcode_check_wizard.xml'
--- packing_barcode_check/packing_barcode_check_wizard.xml 2010-07-26 15:12:49 +0000
+++ packing_barcode_check/packing_barcode_check_wizard.xml 2010-08-18 07:58:38 +0000
@@ -1,18 +1,11 @@
1<?xml version="1.0" encoding="utf-8"?>1<?xml version="1.0" encoding="utf-8"?>
2<openerp>2<openerp>
3 <data>3 <data>
4 <wizard
5 string="Select Picking Wizard"
6 model="stock.picking"
7 name="select.picking"
8 menu="False"
9 id="id_select_picking"/>
10
11 <wizard4 <wizard
12 string="Scan Product"5 string="Scan Product"
13 model="stock.picking"6 model="stock.picking"
14 name="scan.product"7 name="scan.product"
15 menu="True"8 menu="False"
16 id="id_scan_product"/>9 id="id_scan_product"/>
1710
18 </data>11 </data>
1912
=== added file 'packing_barcode_check/packing_barcode_check_workflow.xml'
--- packing_barcode_check/packing_barcode_check_workflow.xml 1970-01-01 00:00:00 +0000
+++ packing_barcode_check/packing_barcode_check_workflow.xml 2010-08-18 07:58:38 +0000
@@ -0,0 +1,26 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record id="act_scanned" model="workflow.activity">
6 <field name="wkf_id" ref="stock.wkf_picking"/>
7 <field name="name">scanned</field>
8 <field name="kind">function</field>
9 <field name="action">action_scanned_wkf()</field>
10 </record>
11
12 <record id="trans_scanned_move" model="workflow.transition">
13 <field name="act_from" ref="stock.act_assigned"/>
14 <field name="act_to" ref="act_scanned"/>
15 <field name="condition">test_scanned()</field>
16 <field name="signal">button_scanned</field>
17 </record>
18
19 <record id="stock.trans_scanned_assigned_move" model="workflow.transition">
20 <field name="act_from" ref="act_scanned"/>
21 <field name="act_to" ref="stock.act_move"/>
22 <field name="signal">button_done</field>
23 </record>
24
25 </data>
26</openerp>
027
=== modified file 'packing_barcode_check/wizard/scan_product.py'
--- packing_barcode_check/wizard/scan_product.py 2010-08-13 14:17:17 +0000
+++ packing_barcode_check/wizard/scan_product.py 2010-08-18 07:58:38 +0000
@@ -22,6 +22,7 @@
22import wizard22import wizard
23import pooler23import pooler
24import time24import time
25import netsvc
25from tools.translate import _26from tools.translate import _
26from osv import osv27from osv import osv
2728
@@ -62,10 +63,14 @@
62 _('Unscanned quantity does not match with the product packaging quantity'))63 _('Unscanned quantity does not match with the product packaging quantity'))
6364
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)
66 wkf_service = netsvc.LocalService("workflow")
67 wkf_service.trg_validate(uid, 'stock.picking', picking_id[0], 'button_scanned', cr)
68
65 return 'init'69 return 'init'
66 else:70 else:
67 raise osv.except_osv(_('Warning!'),71 raise osv.except_osv(_('Warning!'),
68 _('Product does not belongs to this picking or already scanned.'))72 _('Product does not belongs to this picking or already scanned.'))
73
69 return {}74 return {}
7075
71scan_product_lot_form = """<?xml version="1.0"?>76scan_product_lot_form = """<?xml version="1.0"?>
@@ -103,6 +108,9 @@
103 raise osv.except_osv(_('Warning!'),108 raise osv.except_osv(_('Warning!'),
104 _('Unscanned quantity does not match with the product packaging quantity')) 109 _('Unscanned quantity does not match with the product packaging quantity'))
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)
111 wkf_service = netsvc.LocalService("workflow")
112 wkf_service.trg_validate(uid, 'stock.picking', picking_ids[0], 'button_scanned', cr)
113
106 call_product_scan = 2114 call_product_scan = 2
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:
108 call_product_scan = 1116 call_product_scan = 1

Subscribers

People subscribed via source and target branches