mirror of
https://github.com/OCA/manufacture.git
synced 2025-01-28 16:37:15 +02:00
[IMP] mrp_multi_level: reduce some logging
When running the multi level planner, the wizard will delete the records from the previous run (mrp.inventory, mrp.move, mrp.planned.order). There can be hundreds of such records, and the call to unlink() will create a log entry which is not really informative. We disable this log during the call to the wizard (but keep if for manual unlinking of the records which we want to trace).
This commit is contained in:
committed by
Lois Rilo
parent
9786346cf6
commit
2a3a9f704b
@@ -8,7 +8,7 @@ import logging
|
||||
from datetime import date, timedelta
|
||||
|
||||
from odoo import _, api, exceptions, fields, models
|
||||
from odoo.tools import float_is_zero
|
||||
from odoo.tools import float_is_zero, mute_logger
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
@@ -321,6 +321,7 @@ class MultiLevelMrp(models.TransientModel):
|
||||
domain = []
|
||||
if mrp_areas:
|
||||
domain += [("mrp_area_id", "in", mrp_areas.ids)]
|
||||
with mute_logger("odoo.models.unlink"):
|
||||
self.env["mrp.move"].search(domain).unlink()
|
||||
self.env["mrp.inventory"].search(domain).unlink()
|
||||
domain += [("fixed", "=", False)]
|
||||
|
||||
Reference in New Issue
Block a user