修复报废

This commit is contained in:
jinling.yang
2024-08-27 11:24:04 +08:00
parent 9b957848c2
commit b40a87df88
10 changed files with 75 additions and 78 deletions

View File

@@ -151,8 +151,6 @@ class StockRule(models.Model):
list2.append(item)
for procurement, rule in list2:
logging.info(rule)
logging.info(rule.procure_method)
procure_method = rule.procure_method
if rule.procure_method == 'mts_else_mto':
qty_needed = procurement.product_uom._compute_quantity(procurement.product_qty,
@@ -178,10 +176,8 @@ 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)
logging.info(moves)
# Since action_confirm launch following procurement_group we should activate it.
moves._action_confirm()
return True