[REF] audittrail: code refactoring. still not totally working x_x
[odoo/odoo.git] / addons / stock_planning / __openerp__.py
1 # -*- coding: utf-8 -*-
2 ##############################################################################
3 #
4 #    OpenERP, Open Source Management Solution
5 #    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
6 #
7 #    This program is free software: you can redistribute it and/or modify
8 #    it under the terms of the GNU Affero General Public License as
9 #    published by the Free Software Foundation, either version 3 of the
10 #    License, or (at your option) any later version.
11 #
12 #    This program is distributed in the hope that it will be useful,
13 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
14 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 #    GNU Affero General Public License for more details.
16 #
17 #    You should have received a copy of the GNU Affero General Public License
18 #    along with this program.  If not, see <http://www.gnu.org/licenses/>.
19 #
20 ##############################################################################
21
22 {
23     "name": "Master Procurement Schedule",
24     "version": "1.2",
25     "author": "OpenERP SA and Grzegorz Grzelak (OpenGLOBE)",
26     "category": "Hidden",
27     "images": ["images/master_procurement_schedule.jpeg","images/sales_forecast.jpeg","images/stock_planning_line.jpeg","images/stock_sales_period.jpeg"],
28     "depends": ["crm", "stock","sale"],
29     "complexity": "expert",
30     "description": """
31 MPS allows to create a manual procurement plan apart of the normal MRP scheduling, which works automatically based on minimum stock rules
32 =========================================================================================================================================
33
34 Quick Glossary
35 --------------
36 - Stock Period - the time boundaries (between Start Date and End Date) for your Sales and Stock forecasts and planning
37 - Sales Forecast - the quantity of products you plan to sell during the related Stock Period.
38 - Stock Planning - the quantity of products you plan to purchase or produce for the related Stock Period.
39
40 To avoid confusion with the terms used by the ``sale_forecast`` module, ("Sales Forecast" and "Planning" are amounts) we use terms "Stock and Sales Forecast" and "Stock Planning" to emphasize that we use quantity values.
41
42 Where to begin
43 --------------
44 Using this module is done in three steps:
45
46  * Create Stock Periods via the Warehouse>Configuration>Stock Periods menu (Mandatory step)
47  * Create Sale Forecasts fill them with forecast quantities, via the Sales>Sales Forecast menu. (Optional step but useful for further planning)
48  * Create the actual MPS plan, check the balance and trigger the procurements as required. The actual procurement is the final step for the Stock Period.
49
50 Stock Period configuration
51 --------------------------
52 You have two menu items for Periods in "Warehouse > Configuration > Stock Periods". There are:
53
54  * "Create Stock Periods" - can automatically creating daily, weekly or monthly periods.
55  * "Stock Periods" - allows to create any type of periods, change the dates and change the state of period.
56
57 Creating periods is the first step. You can create custom periods using the "New" button in "Stock Periods", but it is recommended to use the automatic assistant "Create Stock Periods".
58
59 Remarks:
60
61  - These periods (Stock Periods) are completely distinct from Financial or other periods in the system.
62  - Periods are not assigned to companies (when you use multicompany). Module suppose that you use the same periods across companies. If you wish to use different periods for different companies define them as you wish (they can overlap). Later on in this text will be indications how to use such periods.
63  - When periods are created automatically their start and finish dates are with start hour 00:00:00 and end hour 23:59:00. When you create daily periods they will have start date 31.01.2010 00:00:00 and end date 31.01.2010 23:59:00. It works only in automatic creation of periods. When you create periods manually you have to take care about hours because you can have incorrect values form sales or stock.
64  - If you use overlapping periods for the same product, warehouse and company results can be unpredictable.
65  - If current date doesn't belong to any period or you have holes between periods results can be unpredictable.
66
67 Sales Forecasts configuration
68 -----------------------------
69 You have few menus for Sales forecast in "Sales > Sales Forecasts":
70
71  - "Create Sales Forecasts" - can automatically create forecast lines according to your needs
72  - "Sales Forecasts" - for managing the Sales forecasts
73
74 Menu "Create Sales Forecasts" creates Forecasts for products from selected Category, for selected Period and for selected Warehouse.
75 It is also possible to copy the previous forecast.
76
77 Remarks:
78
79  - This tool doesn't duplicate lines if you already have an entry for the same Product, Period, Warehouse, created or validated by the same user. If you wish to create another forecast, if relevant lines exists you have to do it manually as described below.
80  - When created lines are validated by someone else you can use this tool to create another line for the same Period, Product and Warehouse.
81  - When you choose "Copy Last Forecast", created line take quantity and other settings from your (validated by you or created by you if not validated yet) forecast which is for last period before period of created forecast.
82
83 On "Sales Forecast" form mainly you have to enter a forecast quantity in "Product Quantity".
84 Further calculation can work for draft forecasts. But validation can save your data against any accidental changes.
85 You can click "Validate" button but it is not mandatory.
86
87 Instead of forecast quantity you may enter the amount of forecast sales via the "Product Amount" field.
88 The system will count quantity from amount according to Sale price of the Product.
89
90 All values on the form are expressed in unit of measure selected on form.
91 You can select a unit of measure from the default category or from secondary category.
92 When you change unit of measure the forecast product quantity will be re-computed according to new UoM.
93
94 To work out your Sale Forecast you can use the "Sales History" of the product.
95 You have to enter parameters to the top and left of this table and system will count sale quantities according to these parameters.
96 So you can get results for a given sales team or period.
97
98
99 MPS or Procurement Planning
100 ---------------------------
101 An MPS planning consists in Stock Planning lines, used to analyze and possibly drive the procurement of 
102 products for each relevant Stock Period and Warehouse.
103 The menu is located in "Warehouse > Schedulers > Master Procurement Schedule":
104
105  - "Create Stock Planning Lines" - a wizard to help automatically create many planning lines
106  - "Master Procurement Schedule" - management of your planning lines
107
108 Similarly to the way Sales forecast serves to define your sales planning, the MPS lets you plan your procurements (Purchase/Manufacturing).
109 You can quickly populate the MPS with the "Create Stock Planning Lines" wizard, and then proceed to review them via the "Master Procurement Schedule" menu.
110
111 The "Create Stock Planning Lines" wizard lets you to quickly create all MPS lines for a given Product Category, and a given Period and Warehouse.
112 When you enable the "All Products with Forecast" option of the wizard, the system creates lines for all products having sales forecast for selected
113 Period and Warehouse (the selected Category will be ignored in this case).
114
115 Under menu "Master Procurement Schedule" you will usually change the "Planned Out" and "Planned In" quantities and observe the resulting "Stock Simulation" value
116 to decide if you need to procure more products for the given Period.
117 "Planned Out" will be initially based on "Warehouse Forecast" which is the sum of all outgoing stock moves already planned for the Period and Warehouse.
118 Of course you can alter this value to provide your own quantities. It is not necessary to have any forecast.
119 "Planned In" quantity is used to calculate field "Incoming Left" which is the quantity to be procured to reach the "Stock Simulation" at the end of Period.
120 You can compare "Stock Simulation" quantity to minimum stock rules visible on the form.
121 And you can plan different quantity than in Minimum Stock Rules. Calculations are done for whole Warehouse by default,
122 if you want to see values for Stock location of calculated warehouse you can check "Stock Location Only".
123
124 When you are satisfied with the "Planned Out", "Planned In" and end of period "Stock Simulation",
125 you can click on "Procure Incoming Left" to create a procurement for the "Incoming Left" quantity.
126 You can decide if procurement will go to the to Stock or Input location of the Warehouse.
127
128 If you don't want to Produce or Buy the product but just transfer the calculated quantity from another warehouse
129 you can click "Supply from Another Warehouse" (instead of "Procure Incoming Left") and the system will
130 create the appropriate picking list (stock moves).
131 You can choose to take the goods from the Stock or the Output location of the source warehouse.
132 Destination location (Stock or Input) in the destination warehouse will be taken as for the procurement case.
133
134 To see update the quantities of "Confirmed In", "Confirmed Out", "Confirmed In Before", "Planned Out Before"
135 and "Stock Simulation" you can press "Calculate Planning".
136
137 All values on the form are expressed in unit of measure selected on form.
138 You can select one of unit of measure from default category or from secondary category.
139 When you change unit of measure the editable quantities will be re-computed according to new UoM. The others will be updated after pressing "Calculate Planning".
140
141 Computation of Stock Simulation quantities
142 ------------------------------------------
143 The Stock Simulation value is the estimated stock quantity at the end of the period.
144 The calculation always starts with the real stock on hand at the beginning of the current period, then
145 adds or subtracts the computed quantities.
146 When you are in the same period (current period is the same as calculated) Stock Simulation is calculated as follows:
147
148 Stock Simulation =
149         Stock of beginning of current Period
150         - Planned Out
151         + Planned In
152
153 When you calculate period next to current:
154
155 Stock Simulation =
156         Stock of beginning of current Period
157         - Planned Out of current Period
158         + Confirmed In of current Period  (incl. Already In)
159         - Planned Out of calculated Period
160         + Planned In of calculated Period .
161
162 As you see the calculated Period is taken the same way as in previous case, but the calculation in the current
163 Period is a little bit different. First you should note that system takes for only Confirmed moves for the
164 current period. This means that you should complete the planning and procurement of the current Period before
165 going to the next one.
166
167 When you plan for future Periods:
168
169 Stock Simulation =
170         Stock of beginning of current Period
171         - Sum of Planned Out of Periods before calculated
172         + Sum of Confirmed In of Periods before calculated (incl. Already In)
173         - Planned Out of calculated Period
174         + Planned In of calculated Period.
175
176 Here "Periods before calculated" designates all periods starting with the current until the period before the one being calculated.
177
178 Remarks:
179
180  - Remember to make the proceed with the planning of each period in chronological order, otherwise the numbers will not reflect the
181    reality
182  - If you planned for future periods and find that real Confirmed Out is larger than Planned Out in some periods before,
183    you can repeat Planning and make another procurement. You should do it in the same planning line.
184    If you create another planning line the suggestions can be wrong.
185  - When you wish to work with different periods for some products, define two kinds of periods (e.g. Weekly and Monthly) and use
186    them for different products. Example: If you use always Weekly periods for Product A, and Monthly periods for Product B
187    all calculations will work correctly. You can also use different kind of periods for the same product from different warehouse
188    or companies. But you cannot use overlapping periods for the same product, warehouse and company because results
189    can be unpredictable. The same applies to Forecasts lines.
190 """,
191     "data": [
192         "security/stock_planning_security.xml",
193         "security/ir.model.access.csv",
194         "stock_planning_view.xml",
195         "wizard/stock_planning_create_periods_view.xml",
196         "wizard/stock_planning_forecast_view.xml",
197         "wizard/stock_planning_createlines_view.xml",
198     ],
199     "test": ["test/stock_planning.yml"],
200     "active": False,
201     "installable": True,
202     "certificate" : "00872589676639788061",
203 }
204 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
205