[REF] stock: remove order point only on scheduler

This functionality was not well know and not necessary
from our point of view thus we chosse to remove it.
This commit is contained in:
amoyaux
2017-09-08 17:08:10 +02:00
parent c1dace134d
commit 59ba6940c9
2 changed files with 6 additions and 16 deletions
+6 -15
View File
@@ -6,22 +6,18 @@
# - Order if the virtual stock of today is bellow the min of the defined order point
#
from odoo import api, models, tools, fields
from odoo import api, models, tools
import logging
import threading
_logger = logging.getLogger(__name__)
class StockSchedulerCompute(models.TransientModel):
_name = 'stock.scheduler.compute'
_description = 'Run Scheduler Manually'
orderpoints_only = fields.Boolean('Only Compute Orderpoints', default=False,
help="When this is checked, it will only calculate the reordering rules for this company. "
"When it is not checked, it will try to reserve stock where there is needed, it will try to "
"solve exception problems (because of routes e.g.) and it will ")
def _procure_calculation_orderpoint(self):
with api.Environment.manage():
# As this function is in a new thread, I need to open a new cursor, because the old one may be closed
@@ -38,15 +34,10 @@ class StockSchedulerCompute(models.TransientModel):
self._cr.close()
return {}
if self.orderpoints_only:
self.env['procurement.group']._procure_orderpoint_confirm(
use_new_cursor=new_cr.dbname,
company_id=self.env.user.company_id.id)
else:
for company in self.env.user.company_ids:
self.env['procurement.group'].run_scheduler(
use_new_cursor=self._cr.dbname,
company_id=company.id)
for company in self.env.user.company_ids:
self.env['procurement.group'].run_scheduler(
use_new_cursor=self._cr.dbname,
company_id=company.id)
new_cr.close()
return {}
@@ -9,7 +9,6 @@
When you run the schedulers, Odoo tries to reserve the available stock to fulfill the existing pickings
and verify if some reordering rules should be triggered.
</p>
<field name="orderpoints_only" groups="base.group_no_one"/>
<footer>
<button name="procure_calculation" string="Run Schedulers" type="object" class="btn-primary"/>
<button string="Cancel" class="btn-default" special="cancel" />