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

Proposed by gpa(OpenERP)
Status: Merged
Merged at revision: 78
Proposed branch: lp:~openbig/bigconsulting/packing_barcode_workflow
Merge into: lp:bigconsulting
Diff against target: 365 lines (+108/-40)
7 files modified
packing_barcode_check/__terp__.py (+3/-1)
packing_barcode_check/packing_barcode_check.py (+37/-7)
packing_barcode_check/packing_barcode_check_view.xml (+6/-3)
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 (+11/-3)
stock_minimum_calculator/wizard/stock_order_point_calculator.py (+24/-18)
To merge this branch: bzr merge lp:~openbig/bigconsulting/packing_barcode_workflow
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+33083@code.launchpad.net

This proposal supersedes a proposal from 2010-08-19.

Description of the change

Added workflow in the packing_barcode_check

To post a comment you must log in.

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-19 05:53:05 +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-19 05:53:05 +0000
@@ -31,23 +31,31 @@
31 def _compute_quantity(self, cr, uid, ids, fieldnames, args, context=None):31 def _compute_quantity(self, cr, uid, ids, fieldnames, args, context=None):
32 res = {}32 res = {}
33 for obj in self.browse(cr, uid, ids, context=context):33 for obj in self.browse(cr, uid, ids, context=context):
34 total_quantity = sum(to_be_id.quantity for to_be_id in obj.tobe_scan_ids)34 total_quantity = sum(move_id.product_qty for move_id in obj.move_lines)
35 scanned_quantity = sum(to_be_id.scan_quantity for to_be_id in obj.tobe_scan_ids)35 scanned_quantity = sum(scan.scan_quantity for scan in obj.scaned_ids)
36 res[obj.id] = {36 res[obj.id] = {
37 'total_quantity' : total_quantity,37 'total_quantity' : total_quantity,
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 }
4141
42 return res42 return res
4343
44
45 _columns = {44 _columns = {
46 'total_quantity':fields.function(_compute_quantity, method=True, string='Total Quantity', multi='quantity'),45 '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'),46 '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'),47 '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'),48 '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',),49 'scaned_ids':fields.one2many('scanned.stock', 'scanned_picking_id', 'Scanned Picking',),
50 'state': fields.selection([
51 ('draft', 'Draft'),
52 ('auto', 'Waiting'),
53 ('confirmed', 'Confirmed'),
54 ('assigned', 'Available'),
55 ('scanned', 'Scanned'),
56 ('done', 'Done'),
57 ('cancel', 'Cancelled'),
58 ], 'Status', readonly=True, select=True),
51 }59 }
52 _defaults = {60 _defaults = {
53 'scanned_quantity' : lambda *a:0.0,61 'scanned_quantity' : lambda *a:0.0,
@@ -58,6 +66,18 @@
58 move_ids = move_obj.search(cr, uid, [('picking_id','=',ids[0])])66 move_ids = move_obj.search(cr, uid, [('picking_id','=',ids[0])])
59 move_obj.write(cr, uid, move_ids, {'scaned_qty':0.0}, context)67 move_obj.write(cr, uid, move_ids, {'scaned_qty':0.0}, context)
60 return True68 return True
69
70 def test_scanned(self, cr, uid, ids, context={}):
71 for pick in self.browse(cr, uid, ids, context=context):
72 if pick.tobe_scan_ids:
73 return False
74 return True
75
76 def action_scanned_wkf(self, cr, uid, ids, context={}):
77 for pick in self.browse(cr, uid, ids, context=context):
78 if not pick.tobe_scan_ids:
79 self.write(cr, uid, ids, {'state': 'scanned'})
80 return True
6181
62stock_picking()82stock_picking()
6383
@@ -65,11 +85,19 @@
65 _inherit = "stock.move"85 _inherit = "stock.move"
66 _columns = {86 _columns = {
67 'scaned_qty':fields.float("Scanned Qty"),87 'scaned_qty':fields.float("Scanned Qty"),
88 'unscaned_qty':fields.float("Unscanned Qty"),
68 }89 }
69 90
70 _defaults = {91 _defaults = {
71 'scaned_qty' : lambda *a:0.0,92 'scaned_qty' : lambda *a:0.0,
72 }93 }
94
95 def onchange_quantity(self, cr, uid, ids, product_id, product_qty, product_uom, product_uos):
96
97 result = super(stock_move, self).onchange_quantity(cr, uid, ids, product_id, product_qty, product_uom, product_uos)
98 if product_id:
99 result['value']['unscaned_qty'] = product_qty
100 return result
73stock_move()101stock_move()
74102
75class tobe_scanned_stock(osv.osv):103class tobe_scanned_stock(osv.osv):
@@ -80,7 +108,8 @@
80 'product_name':fields.many2one('product.product','Product Name', size=64),108 'product_name':fields.many2one('product.product','Product Name', size=64),
81 'lot_number':fields.many2one('stock.production.lot','Lot Number', size=64),109 'lot_number':fields.many2one('stock.production.lot','Lot Number', size=64),
82 'quantity':fields.float("Quantity"),110 'quantity':fields.float("Quantity"),
83 'scan_quantity':fields.float("Scan Quantity"),111 'scan_quantity':fields.float("Scanned Quantity"),
112 'unscan_quantity':fields.float("Unscanned Quantity"),
84 }113 }
85 114
86 def init(self, cr):115 def init(self, cr):
@@ -92,6 +121,7 @@
92 l.picking_id AS tobe_picking_id,121 l.picking_id AS tobe_picking_id,
93 sum(l.scaned_qty) AS scan_quantity,122 sum(l.scaned_qty) AS scan_quantity,
94 sum(l.product_qty) AS quantity,123 sum(l.product_qty) AS quantity,
124 sum(l.unscaned_qty) AS unscan_quantity,
95 l.prodlot_id AS lot_number,125 l.prodlot_id AS lot_number,
96 l.product_id AS product_name126 l.product_id AS product_name
97 FROM127 FROM
@@ -112,7 +142,7 @@
112 'product_name':fields.many2one('product.product','Product Name', size=64),142 'product_name':fields.many2one('product.product','Product Name', size=64),
113 'lot_number':fields.many2one('stock.production.lot','Lot Number', size=64),143 'lot_number':fields.many2one('stock.production.lot','Lot Number', size=64),
114 'quantity':fields.float("Quantity"),144 'quantity':fields.float("Quantity"),
115 'scan_quantity':fields.float("Scan Quantity"),145 'scan_quantity':fields.float("Scanned Quantity"),
116 }146 }
117 147
118 def init(self, cr):148 def init(self, cr):
@@ -129,7 +159,7 @@
129 FROM159 FROM
130 stock_move l160 stock_move l
131 WHERE161 WHERE
132 l.scaned_qty = l.product_qty162 l.scaned_qty > 0
133 GROUP BY163 GROUP BY
134 l.product_id,l.prodlot_id,l.picking_id, l.id164 l.product_id,l.prodlot_id,l.picking_id, l.id
135 )165 )
136166
=== 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-19 05:53:05 +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">
@@ -48,7 +48,7 @@
48 <field name="product_name"/>48 <field name="product_name"/>
49 <field name="lot_number"/>49 <field name="lot_number"/>
50 <field name="quantity"/>50 <field name="quantity"/>
51 <field name="scan_quantity"/>51 <field name="unscan_quantity"/>
52 </tree>52 </tree>
53 </field> 53 </field>
54 <field name="scaned_ids" nolabel="1">54 <field name="scaned_ids" nolabel="1">
@@ -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>
@@ -104,11 +106,12 @@
104 <field name="arch" type="xml">106 <field name="arch" type="xml">
105 <xpath expr="//field[@name='product_qty']" position="after">107 <xpath expr="//field[@name='product_qty']" position="after">
106 <field name="scaned_qty"/>108 <field name="scaned_qty"/>
109 <field name="unscaned_qty"/>
107 </xpath>110 </xpath>
108 </field>111 </field>
109 </record>112 </record>
110113
111 <wizard id="act_selct_picking_open_form" model="stock.picking" name="select.picking" string="Select picking"/>114 <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"/>115 <menuitem action="act_selct_picking_open_form" id="menu_act_selct_picking_open_form" parent="stock.menu_stock_root" type="wizard"/>
113116
114 </data>117 </data>
115118
=== 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-19 05:53:05 +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-19 05:53:05 +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-19 05:53:05 +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
@@ -61,11 +62,15 @@
61 raise osv.except_osv(_('Warning!'),62 raise osv.except_osv(_('Warning!'),
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, 'unscaned_qty':move_data.unscaned_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"?>
@@ -102,9 +107,12 @@
102 if check_qty < quantity:107 if check_qty < quantity:
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,'unscaned_qty':stock_move_obj.unscaned_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+quantity:
108 call_product_scan = 1116 call_product_scan = 1
109 break117 break
110 if call_product_scan == 1:118 if call_product_scan == 1:
111119
=== modified file 'stock_minimum_calculator/wizard/stock_order_point_calculator.py'
--- stock_minimum_calculator/wizard/stock_order_point_calculator.py 2010-08-17 04:44:06 +0000
+++ stock_minimum_calculator/wizard/stock_order_point_calculator.py 2010-08-19 05:53:05 +0000
@@ -215,7 +215,7 @@
215 # 1. Calculation of the date date start in one year later than current date215 # 1. Calculation of the date date start in one year later than current date
216 from_date = (datetime.now() - relativedelta(months=12)).strftime('%Y-%m-%d %H:%M:%S')216 from_date = (datetime.now() - relativedelta(months=12)).strftime('%Y-%m-%d %H:%M:%S')
217 to_date = datetime.now().strftime('%Y-%m-%d %H:%M:%S')217 to_date = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
218 218
219 # 2.1 first find the all the product which fullfill the criteria of the 2.1219 # 2.1 first find the all the product which fullfill the criteria of the 2.1
220 product_ids = product_obj.search(cr,uid,[('active','=',True),('type','=','product'),220 product_ids = product_obj.search(cr,uid,[('active','=',True),('type','=','product'),
221 ('procure_method','=','make_to_stock'),221 ('procure_method','=','make_to_stock'),
@@ -246,8 +246,7 @@
246 if seller_id.name.id == partner_id:246 if seller_id.name.id == partner_id:
247 supplier_lead_time = seller_id.delay247 supplier_lead_time = seller_id.delay
248 248
249 stock_move_ids = stock_move_obj.search(cr, uid, [('product_id','=',filter_product_id)])249 stock_move_ids = stock_move_obj.search(cr, uid, [('product_id','=',filter_product_id),('state','=','done')])
250
251 average_daily_consumption = 0.0 250 average_daily_consumption = 0.0
252 first_stock_move_ids = []251 first_stock_move_ids = []
253 # Take the first input date of the stock move where stock move of incoming picking or stock move not have any picking 252 # Take the first input date of the stock move where stock move of incoming picking or stock move not have any picking
@@ -258,16 +257,16 @@
258 first_stock_move_ids.append(first_stock_id)257 first_stock_move_ids.append(first_stock_id)
259 else:258 else:
260 first_stock_move_ids.append(first_stock_id)259 first_stock_move_ids.append(first_stock_id)
261260
262 if first_stock_move_ids:261 if first_stock_move_ids:
263 first_stock_move_id = first_stock_move_ids[0]262 first_stock_move_id = first_stock_move_ids[0]
264 first_input = stock_move_obj.browse(cr, uid, first_stock_move_id, context=context).date_planned263 first_input = stock_move_obj.browse(cr, uid, first_stock_move_id, context=context).date_planned
265264
266 # Case 1 if first input is less than from date265 # Case 1 if first input is less than from date
267 if first_input <= from_date:266 if first_input <= from_date:
268 consum_qty = _sale_consume_qty(self, cr, uid, from_date, to_date, 'done', context)267 consum_qty = _sale_consume_qty(self, cr, uid, filter_product_id, from_date, to_date, 'done', context)
269 refund_qty = _refund_qty(self, cr, uid, filter_product_id, from_date, to_date, ['out_refund','in_refund'], context)268 refund_qty = _refund_qty(self, cr, uid, filter_product_id, from_date, to_date, ['out_refund','in_refund'], context)
270 open_sale_qty = _sale_open_qty(self, cr, uid, filter_product_id, from_date, to_date, ['manual','progress'], context) 269 open_sale_qty = _sale_open_qty(self, cr, uid, filter_product_id, ['manual','progress'], context)
271 open_purchase_qty = _purchase_open_qty(self, cr, uid, filter_product_id, 'approved', context) 270 open_purchase_qty = _purchase_open_qty(self, cr, uid, filter_product_id, 'approved', context)
272 pur_diff_day = _date_diff(self, cr, uid, filter_product_id, from_date, to_date, context) 271 pur_diff_day = _date_diff(self, cr, uid, filter_product_id, from_date, to_date, context)
273 ### calculation of average_daily_consumption272 ### calculation of average_daily_consumption
@@ -287,20 +286,26 @@
287 average_daily_consumption = (consum_qty - refund_qty + open_sale_qty - open_purchase_qty) / pur_diff_day286 average_daily_consumption = (consum_qty - refund_qty + open_sale_qty - open_purchase_qty) / pur_diff_day
288 else:287 else:
289 open_sale_qty = _sale_open_qty(self, cr, uid, filter_product_id, ['manual','progress'], context)288 open_sale_qty = _sale_open_qty(self, cr, uid, filter_product_id, ['manual','progress'], context)
290 open_purchase_qty = _purchase_open_qty(self, cr, uid, filter_product_id, 'approved', context)289 open_purchase_qty = _purchase_open_qty(self, cr, uid, filter_product_id, 'approved', context)
290
291 if open_purchase_qty == 0.0 or open_sale_qty == 0.0:
292 continue
291 293
292 # calculation of first open purchase order date 294 # calculation of first open purchase order date
293 open_purchase_ids = purchase_obj.search(cr,uid,[('state','=','approved')]) 295 open_purchase_ids = purchase_obj.search(cr,uid,[('state','=','approved')])
294 first_open_purchase_order = min(open_purchase_ids)296 if open_purchase_ids:
295 fst_open_pur_date = purchase_obj.browse(cr, uid, first_open_purchase_order, context=context).date_order297 first_open_purchase_order = min(open_purchase_ids)
298 fst_open_pur_date = purchase_obj.browse(cr, uid, first_open_purchase_order, context=context).date_order
296 299
297 # Days difference between to date and first purchase date300 # Days difference between to date and first purchase date
298 pur_to_date = time.mktime(time.strptime(to_date,'%Y-%m-%d %H:%M:%S'))301 pur_diff_day = 0.0
299 pur_open_date = time.mktime(time.strptime(fst_open_pur_date,'%Y-%m-%d'))302 if fst_open_pur_date:
300 pur_diff_day = (pur_to_date-pur_open_date)/(3600*24)303 pur_to_date = time.mktime(time.strptime(to_date,'%Y-%m-%d %H:%M:%S'))
301 304 pur_open_date = time.mktime(time.strptime(fst_open_pur_date,'%Y-%m-%d'))
302 if pur_diff_day>0:305 pur_diff_day = (pur_to_date-pur_open_date)/(3600*24)
303 average_daily_consumption = (open_sale_qty - open_purchase_qty)/pur_diff_day306
307 if pur_diff_day>0:
308 average_daily_consumption = (open_sale_qty - open_purchase_qty)/pur_diff_day
304 309
305 ###### Calculation of plan_average_daily_consumption310 ###### Calculation of plan_average_daily_consumption
306 plan_average_daily_consumption = 0.0311 plan_average_daily_consumption = 0.0
@@ -327,6 +332,7 @@
327 min_rule_obj.unlink(cr, uid, [stock_rule_id],context=context)332 min_rule_obj.unlink(cr, uid, [stock_rule_id],context=context)
328 333
329 mini_stock_rule_id = min_rule_obj.search(cr,uid,[('warehouse_id','=',data['form']['warehouse_id']),('product_id','=',filter_product_id)])334 mini_stock_rule_id = min_rule_obj.search(cr,uid,[('warehouse_id','=',data['form']['warehouse_id']),('product_id','=',filter_product_id)])
335
330 if mini_stock_rule_id:336 if mini_stock_rule_id:
331 for stock_rule_id in mini_stock_rule_id:337 for stock_rule_id in mini_stock_rule_id:
332 min_rule_obj.write(cr, uid, [stock_rule_id],{'product_min_qty':product_min_qty,'product_max_qty':product_max_qty,},context=context)338 min_rule_obj.write(cr, uid, [stock_rule_id],{'product_min_qty':product_min_qty,'product_max_qty':product_max_qty,},context=context)

Subscribers

People subscribed via source and target branches