Setup forecast for all supplies
issue8702 review250041003
This commit is contained in:
1 parent
37f7e7fd11
commit
dc78e7b3a4
3 files changed
+9
-8
No files matched your search
@@ -1,3 +1,4 @@
|
||||
* Setup forecast for all supplies
|
||||
* Add support for Python 3.10
|
||||
* Remove support for Python 3.6
|
||||
|
||||
|
||||
+3
-3
@@ -3,10 +3,10 @@
|
||||
|
||||
from trytond.pool import Pool
|
||||
|
||||
from . import purchase_request
|
||||
from . import stock
|
||||
|
||||
|
||||
def register():
|
||||
Pool.register(
|
||||
purchase_request.Request,
|
||||
module='stock_supply_forecast', type_='model')
|
||||
stock.Supply,
|
||||
module='stock_supply_forecast', type_='wizard')
|
||||
@@ -3,11 +3,10 @@
|
||||
from trytond.pool import Pool, PoolMeta
|
||||
|
||||
|
||||
class Request(metaclass=PoolMeta):
|
||||
__name__ = 'purchase.request'
|
||||
class Supply(metaclass=PoolMeta):
|
||||
__name__ = 'stock.supply'
|
||||
|
||||
@classmethod
|
||||
def generate_requests(cls, *args, **kwargs):
|
||||
def transition_create_(self):
|
||||
pool = Pool()
|
||||
Forecast = pool.get('stock.forecast')
|
||||
Date = pool.get('ir.date')
|
||||
@@ -19,5 +18,6 @@ class Request(metaclass=PoolMeta):
|
||||
('state', '=', 'done'),
|
||||
])
|
||||
Forecast.create_moves(forecasts)
|
||||
super().generate_requests(*args, **kwargs)
|
||||
transition = super().transition_create_()
|
||||
Forecast.delete_moves(forecasts)
|
||||
return transition
|
||||
Reference in new issue
Block a user