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

Proposed by gpa(OpenERP)
Status: Merged
Merged at revision: 88
Proposed branch: lp:~openbig/bigconsulting/sales_shop_stock_avialblity
Merge into: lp:bigconsulting
Diff against target: 83 lines (+6/-26)
2 files modified
sales_shop_stock_availability/sales_shop_stock_availability.py (+2/-2)
stock_minimum_calculator/wizard/stock_order_point_calculator.py (+4/-24)
To merge this branch: bzr merge lp:~openbig/bigconsulting/sales_shop_stock_avialblity
Reviewer Review Type Date Requested Status
openbig Pending
Review via email: mp+35252@code.launchpad.net

Description of the change

Solved the bug of the sales_shop_stock_avialbility

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

Subscribers

People subscribed via source and target branches