Merge lp:~openbig/bigconsulting/order_point_calculator into lp:bigconsulting
- order_point_calculator
- Merge into addons
Proposed by
gpa(OpenERP)
Status: | Merged |
---|---|
Merged at revision: | 78 |
Proposed branch: | lp:~openbig/bigconsulting/order_point_calculator |
Merge into: | lp:bigconsulting |
Diff against target: |
278 lines (+87/-31) 7 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) stock_minimum_calculator/wizard/stock_order_point_calculator.py (+24/-18) |
To merge this branch: | bzr merge lp:~openbig/bigconsulting/order_point_calculator |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
openbig | Pending | ||
Review via email: mp+32980@code.launchpad.net |
This proposal supersedes a proposal from 2010-08-18.
Commit message
Description of the change
changes in the stock order point wizard
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
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 11:09:43 +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 11:09:43 +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 11:09:43 +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 11:09:43 +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 11:09:43 +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 11:09:43 +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 |
189 | 109 | 117 | ||
190 | === modified file 'stock_minimum_calculator/wizard/stock_order_point_calculator.py' | |||
191 | --- stock_minimum_calculator/wizard/stock_order_point_calculator.py 2010-08-17 04:44:06 +0000 | |||
192 | +++ stock_minimum_calculator/wizard/stock_order_point_calculator.py 2010-08-18 11:09:43 +0000 | |||
193 | @@ -215,7 +215,7 @@ | |||
194 | 215 | # 1. Calculation of the date date start in one year later than current date | 215 | # 1. Calculation of the date date start in one year later than current date |
195 | 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') |
196 | 217 | to_date = datetime.now().strftime('%Y-%m-%d %H:%M:%S') | 217 | to_date = datetime.now().strftime('%Y-%m-%d %H:%M:%S') |
198 | 218 | 218 | ||
199 | 219 | # 2.1 first find the all the product which fullfill the criteria of the 2.1 | 219 | # 2.1 first find the all the product which fullfill the criteria of the 2.1 |
200 | 220 | product_ids = product_obj.search(cr,uid,[('active','=',True),('type','=','product'), | 220 | product_ids = product_obj.search(cr,uid,[('active','=',True),('type','=','product'), |
201 | 221 | ('procure_method','=','make_to_stock'), | 221 | ('procure_method','=','make_to_stock'), |
202 | @@ -246,8 +246,7 @@ | |||
203 | 246 | if seller_id.name.id == partner_id: | 246 | if seller_id.name.id == partner_id: |
204 | 247 | supplier_lead_time = seller_id.delay | 247 | supplier_lead_time = seller_id.delay |
205 | 248 | 248 | ||
208 | 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')]) |
207 | 250 | |||
209 | 251 | average_daily_consumption = 0.0 | 250 | average_daily_consumption = 0.0 |
210 | 252 | first_stock_move_ids = [] | 251 | first_stock_move_ids = [] |
211 | 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 |
212 | @@ -258,16 +257,16 @@ | |||
213 | 258 | first_stock_move_ids.append(first_stock_id) | 257 | first_stock_move_ids.append(first_stock_id) |
214 | 259 | else: | 258 | else: |
215 | 260 | first_stock_move_ids.append(first_stock_id) | 259 | first_stock_move_ids.append(first_stock_id) |
217 | 261 | 260 | ||
218 | 262 | if first_stock_move_ids: | 261 | if first_stock_move_ids: |
219 | 263 | first_stock_move_id = first_stock_move_ids[0] | 262 | first_stock_move_id = first_stock_move_ids[0] |
220 | 264 | first_input = stock_move_obj.browse(cr, uid, first_stock_move_id, context=context).date_planned | 263 | first_input = stock_move_obj.browse(cr, uid, first_stock_move_id, context=context).date_planned |
222 | 265 | 264 | ||
223 | 266 | # Case 1 if first input is less than from date | 265 | # Case 1 if first input is less than from date |
224 | 267 | if first_input <= from_date: | 266 | if first_input <= from_date: |
226 | 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) |
227 | 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) |
229 | 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) |
230 | 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) |
231 | 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) |
232 | 273 | ### calculation of average_daily_consumption | 272 | ### calculation of average_daily_consumption |
233 | @@ -287,20 +286,26 @@ | |||
234 | 287 | average_daily_consumption = (consum_qty - refund_qty + open_sale_qty - open_purchase_qty) / pur_diff_day | 286 | average_daily_consumption = (consum_qty - refund_qty + open_sale_qty - open_purchase_qty) / pur_diff_day |
235 | 288 | else: | 287 | else: |
236 | 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) |
238 | 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) |
239 | 290 | |||
240 | 291 | if open_purchase_qty == 0.0 or open_sale_qty == 0.0: | ||
241 | 292 | continue | ||
242 | 291 | 293 | ||
243 | 292 | # calculation of first open purchase order date | 294 | # calculation of first open purchase order date |
247 | 293 | open_purchase_ids = purchase_obj.search(cr,uid,[('state','=','approved')]) | 295 | open_purchase_ids = purchase_obj.search(cr,uid,[('state','=','approved')]) |
248 | 294 | first_open_purchase_order = min(open_purchase_ids) | 296 | if open_purchase_ids: |
249 | 295 | fst_open_pur_date = purchase_obj.browse(cr, uid, first_open_purchase_order, context=context).date_order | 297 | first_open_purchase_order = min(open_purchase_ids) |
250 | 298 | fst_open_pur_date = purchase_obj.browse(cr, uid, first_open_purchase_order, context=context).date_order | ||
251 | 296 | 299 | ||
259 | 297 | # Days difference between to date and first purchase date | 300 | # Days difference between to date and first purchase date |
260 | 298 | pur_to_date = time.mktime(time.strptime(to_date,'%Y-%m-%d %H:%M:%S')) | 301 | pur_diff_day = 0.0 |
261 | 299 | pur_open_date = time.mktime(time.strptime(fst_open_pur_date,'%Y-%m-%d')) | 302 | if fst_open_pur_date: |
262 | 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')) |
263 | 301 | 304 | pur_open_date = time.mktime(time.strptime(fst_open_pur_date,'%Y-%m-%d')) | |
264 | 302 | if pur_diff_day>0: | 305 | pur_diff_day = (pur_to_date-pur_open_date)/(3600*24) |
265 | 303 | average_daily_consumption = (open_sale_qty - open_purchase_qty)/pur_diff_day | 306 | |
266 | 307 | if pur_diff_day>0: | ||
267 | 308 | average_daily_consumption = (open_sale_qty - open_purchase_qty)/pur_diff_day | ||
268 | 304 | 309 | ||
269 | 305 | ###### Calculation of plan_average_daily_consumption | 310 | ###### Calculation of plan_average_daily_consumption |
270 | 306 | plan_average_daily_consumption = 0.0 | 311 | plan_average_daily_consumption = 0.0 |
271 | @@ -327,6 +332,7 @@ | |||
272 | 327 | min_rule_obj.unlink(cr, uid, [stock_rule_id],context=context) | 332 | min_rule_obj.unlink(cr, uid, [stock_rule_id],context=context) |
273 | 328 | 333 | ||
274 | 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)]) |
275 | 335 | |||
276 | 330 | if mini_stock_rule_id: | 336 | if mini_stock_rule_id: |
277 | 331 | for stock_rule_id in mini_stock_rule_id: | 337 | for stock_rule_id in mini_stock_rule_id: |
278 | 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) |