diff --git a/CHANGELOG b/CHANGELOG
index 9de887ed07..09f33f5728 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,4 @@
+* Merge supply into one wizard
* Do not create production request if other order point exists
Version 4.2.0 - 2016-11-28
diff --git a/__init__.py b/__init__.py
index 594cae588b..0e08b0301a 100644
--- a/__init__.py
+++ b/__init__.py
@@ -13,9 +13,8 @@ def register():
LocationLeadTime,
Configuration,
Production,
- CreateProductionRequestStart,
Product,
module='stock_supply_production', type_='model')
Pool.register(
- CreateProductionRequest,
+ StockSupply,
module='stock_supply_production', type_='wizard')
diff --git a/doc/index.rst b/doc/index.rst
index 6b8ca25441..c09c4954b1 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -22,6 +22,6 @@ It adds a new type of Order Point:
quantity is reached at any time on the warehouse it will result in a
production request.
-The production requests are created by the schedulers with respect to stock
+The production requests are created by the supply wizard with respect to stock
levels and existing requests. The stock levels are computed on the supply
period define in the production configuration.
diff --git a/production.py b/production.py
index 08deb5f747..41eb115c71 100644
--- a/production.py
+++ b/production.py
@@ -3,14 +3,12 @@
import datetime
from collections import defaultdict
-from trytond.model import ModelView, fields
+from trytond.model import fields
from trytond.pool import Pool, PoolMeta
from trytond.transaction import Transaction
-from trytond.wizard import Wizard, StateView, StateAction, Button
from trytond.tools import grouped_slice
-__all__ = ['Configuration', 'Production',
- 'CreateProductionRequestStart', 'CreateProductionRequest']
+__all__ = ['Configuration', 'Production']
class Configuration:
@@ -119,8 +117,6 @@ class Production:
req.save()
req.set_moves()
requests.append(req)
- if requests:
- cls.generate_requests(False, warehouses)
return requests
@classmethod
@@ -211,52 +207,3 @@ class Production:
current_qties[product_id] += qty
return shortages
-
-
-class CreateProductionRequestStart(ModelView):
- 'Create Production Request'
- __name__ = 'production.create_request.start'
-
-
-class CreateProductionRequest(Wizard):
- 'Create Production Requests'
- __name__ = 'production.create_request'
- start = StateView('production.create_request.start',
- 'stock_supply_production.production_create_request_start_view_form', [
- Button('Cancel', 'end', 'tryton-cancel'),
- Button('Create', 'create_', 'tryton-ok', default=True),
- ])
- create_ = StateAction('stock_supply_production.act_production_request')
-
- @classmethod
- def __setup__(cls):
- super(CreateProductionRequest, cls).__setup__()
- cls._error_messages.update({
- 'late_productions': 'There are some late productions.',
- })
-
- @property
- def _requests_parameters(self):
- return {}
-
- def do_create_(self, action):
- pool = Pool()
- Date = pool.get('ir.date')
- Move = pool.get('stock.move')
- Production = pool.get('production')
-
- today = Date.today()
- if Move.search([
- ('from_location.type', '=', 'production'),
- ('to_location.type', '=', 'storage'),
- ('state', '=', 'draft'),
- ('planned_date', '<', today),
- ], order=[]):
- self.raise_user_warning('%s@%s' % (self.__name__, today),
- 'late_productions')
-
- Production.generate_requests(**self._requests_parameters)
- return action, {}
-
- def transition_create_(self):
- return 'end'
diff --git a/production.xml b/production.xml
index b648768c33..381ea47765 100644
--- a/production.xml
+++ b/production.xml
@@ -11,18 +11,6 @@ this repository contains the full copyright notices and license terms. -->