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
1=== modified file 'stock_minimum_calculator/wizard/stock_order_point_calculator.py'
2--- stock_minimum_calculator/wizard/stock_order_point_calculator.py 2010-09-07 13:16:30 +0000
3+++ stock_minimum_calculator/wizard/stock_order_point_calculator.py 2010-09-13 05:37:47 +0000
4@@ -77,7 +77,6 @@
5 'string':"Method Calculation",
6 'type':'selection',
7 'selection':[('his_cons_with_product', 'Calculate with planning values'),
8- ('his_cons_without_product', 'Calculate with Out historical consumptions of product'),
9 ('hist_cons_and_open_sale', 'Calculate with historical values'),
10 ],'required': True,
11 'default': lambda *a:'his_cons_with_product'
12@@ -85,14 +84,11 @@
13 }
14
15 _messages_form = '''<?xml version="1.0"?>
16-<form string="Warning">
17- <label string="Information Regarding Method of Calculation" colspan="4"/>
18- <field name="message" colspan="4" nolabel="1"/>
19+<form string="Message">
20+ <label string="Calculations successfully done !" colspan="4"/>
21 </form>'''
22
23-_message_fields = {
24- 'message': {'string':'Message' ,'type':'text', 'readonly':True}
25-}
26+_message_fields = {}
27
28 def _get_default(obj, cr, uid, data, context=None):
29 pool = pooler.get_pool(cr.dbname)
30@@ -315,10 +311,6 @@
31 product_min_qty = int(math.ceil(average_daily_consumption * (supplier_lead_time + purchase_lead_time) * seasonal_factor))
32 product_max_qty = max_qty_factor * product_min_qty
33
34- elif data['form']['method_qty_calculation'] == 'his_cons_without_product':
35- product_min_qty = int(math.ceil(plan_average_daily_consumption * (supplier_lead_time + purchase_lead_time) * seasonal_factor))
36- product_max_qty = max_qty_factor * product_min_qty
37-
38 else:
39 try:
40 product_min_qty = int(math.ceil((consum_qty + open_sale_qty) / pur_diff_day * (supplier_lead_time + purchase_lead_time) * seasonal_factor))
41@@ -354,18 +346,6 @@
42
43 return {}
44
45-def _get_message(self, cr, uid, data, context):
46-
47- if data['form']['method_qty_calculation'] == 'his_cons_with_product':
48- 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")
49- elif data['form']['method_qty_calculation'] == 'his_cons_without_product':
50- 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")
51- else:
52- 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.")
53- return data['form']
54-
55-
56-
57 class orderpoint_calculator(wizard.interface):
58 states = {
59 'init' : {
60@@ -382,7 +362,7 @@
61 },
62
63 'end2': {
64- 'actions': [ _get_message ],
65+ 'actions': [],
66 'result': {'type': 'form', 'arch': _messages_form,
67 'fields': _message_fields,
68 'state': (

Subscribers

People subscribed via source and target branches