优化报废
This commit is contained in:
@@ -68,6 +68,7 @@ class StockRule(models.Model):
|
||||
|
||||
@api.model
|
||||
def _run_pull(self, procurements):
|
||||
logging.info(procurements)
|
||||
moves_values_by_company = defaultdict(list)
|
||||
mtso_products_by_locations = defaultdict(list)
|
||||
|
||||
@@ -176,6 +177,7 @@ class StockRule(models.Model):
|
||||
for company_id, moves_values in moves_values_by_company.items():
|
||||
# create the move as SUPERUSER because the current user may not have the rights to do it (mto product
|
||||
# launched by a sale for example)
|
||||
logging.info(moves_values)
|
||||
moves = self.env['stock.move'].with_user(SUPERUSER_ID).sudo().with_company(company_id).create(moves_values)
|
||||
# Since action_confirm launch following procurement_group we should activate it.
|
||||
moves._action_confirm()
|
||||
|
||||
Reference in New Issue
Block a user