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

Proposed by gpa(OpenERP)
Status: Superseded
Proposed branch: lp:~openbig/bigconsulting/stock_min_cal_bug
Merge into: lp:bigconsulting
Diff against target: 68 lines (+4/-24)
1 file modified
stock_minimum_calculator/wizard/stock_order_point_calculator.py (+4/-24)
To merge this branch: bzr merge lp:~openbig/bigconsulting/stock_min_cal_bug
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+35249@code.launchpad.net

This proposal has been superseded by a proposal from 2010-09-13.

Description of the change

Solved the bug of stock_min_calculator.

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

solve the bug of the stock_minimum_calculator

96. By gpa(OpenERP)

solve the bug of the stock_minimum_calculator

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'stock_minimum_calculator/wizard/stock_order_point_calculator.py'
--- stock_minimum_calculator/wizard/stock_order_point_calculator.py 2010-09-07 13:16:30 +0000
+++ stock_minimum_calculator/wizard/stock_order_point_calculator.py 2010-09-13 05:37:47 +0000
@@ -77,7 +77,6 @@
77 'string':"Method Calculation",77 'string':"Method Calculation",
78 'type':'selection',78 'type':'selection',
79 'selection':[('his_cons_with_product', 'Calculate with planning values'),79 'selection':[('his_cons_with_product', 'Calculate with planning values'),
80 ('his_cons_without_product', 'Calculate with Out historical consumptions of product'),
81 ('hist_cons_and_open_sale', 'Calculate with historical values'),80 ('hist_cons_and_open_sale', 'Calculate with historical values'),
82 ],'required': True,81 ],'required': True,
83 'default': lambda *a:'his_cons_with_product'82 'default': lambda *a:'his_cons_with_product'
@@ -85,14 +84,11 @@
85}84}
8685
87_messages_form = '''<?xml version="1.0"?>86_messages_form = '''<?xml version="1.0"?>
88<form string="Warning">87<form string="Message">
89 <label string="Information Regarding Method of Calculation" colspan="4"/>88 <label string="Calculations successfully done !" colspan="4"/>
90 <field name="message" colspan="4" nolabel="1"/>
91</form>'''89</form>'''
9290
93_message_fields = {91_message_fields = {}
94 'message': {'string':'Message' ,'type':'text', 'readonly':True}
95}
9692
97def _get_default(obj, cr, uid, data, context=None):93def _get_default(obj, cr, uid, data, context=None):
98 pool = pooler.get_pool(cr.dbname)94 pool = pooler.get_pool(cr.dbname)
@@ -315,10 +311,6 @@
315 product_min_qty = int(math.ceil(average_daily_consumption * (supplier_lead_time + purchase_lead_time) * seasonal_factor))311 product_min_qty = int(math.ceil(average_daily_consumption * (supplier_lead_time + purchase_lead_time) * seasonal_factor))
316 product_max_qty = max_qty_factor * product_min_qty312 product_max_qty = max_qty_factor * product_min_qty
317 313
318 elif data['form']['method_qty_calculation'] == 'his_cons_without_product':
319 product_min_qty = int(math.ceil(plan_average_daily_consumption * (supplier_lead_time + purchase_lead_time) * seasonal_factor))
320 product_max_qty = max_qty_factor * product_min_qty
321
322 else:314 else:
323 try:315 try:
324 product_min_qty = int(math.ceil((consum_qty + open_sale_qty) / pur_diff_day * (supplier_lead_time + purchase_lead_time) * seasonal_factor))316 product_min_qty = int(math.ceil((consum_qty + open_sale_qty) / pur_diff_day * (supplier_lead_time + purchase_lead_time) * seasonal_factor))
@@ -354,18 +346,6 @@
354 346
355 return {}347 return {}
356348
357def _get_message(self, cr, uid, data, context):
358
359 if data['form']['method_qty_calculation'] == 'his_cons_with_product':
360 data['form']['message'] = _("Are your sure that you have enough historical data to calculate stock orderpoint rules with this methodology, Otherwise you should try the other options, \n Calculate without historical consumption of products or ,Calculate with historical consumption of products and sales orders")
361 elif data['form']['method_qty_calculation'] == 'his_cons_without_product':
362 data['form']['message'] = _("Your calculation is based on the field plan average daily consumption.\n Are your sure not to calculate with the method , Calculate with historical consumption of products")
363 else:
364 data['form']['message'] = _("Are your sure that you have really not enough historical data to calculate stock orderpoint rules? \n Otherwise you should prefer the options , Calculate with historical consumption of products. This results may calculate better results than calculation with this methodology.")
365 return data['form']
366
367
368
369class orderpoint_calculator(wizard.interface):349class orderpoint_calculator(wizard.interface):
370 states = {350 states = {
371 'init' : {351 'init' : {
@@ -382,7 +362,7 @@
382 },362 },
383363
384 'end2': {364 'end2': {
385 'actions': [ _get_message ],365 'actions': [],
386 'result': {'type': 'form', 'arch': _messages_form,366 'result': {'type': 'form', 'arch': _messages_form,
387 'fields': _message_fields,367 'fields': _message_fields,
388 'state': (368 'state': (

Subscribers

People subscribed via source and target branches