[MIG] account_asset_batch_compute: Migration to 13.0

This commit is contained in:
Alba Riera
2021-02-22 18:39:52 +01:00
committed by Olga Marco
parent 1b0c9c8029
commit a1a70669f9
9 changed files with 68 additions and 53 deletions

View File

@@ -1,24 +1,13 @@
# Copyright 2016 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
import logging
from odoo import _, api, models
_logger = logging.getLogger(__name__)
try:
from odoo.addons.queue_job.job import job
except ImportError:
_logger.debug("Can not `import queue_job`.")
from odoo import _, models
class AccountAsset(models.Model):
_inherit = "account.asset"
@api.multi
@job(default_channel="root.account_asset_batch_compute")
def _compute_entries(self, date_end, check_triggers=False):
if self.env.context.get(
"asset_batch_processing", False