diff --git a/product_planned_price/models/product_template.py b/product_planned_price/models/product_template.py index 0a6c8806e..6901c18e5 100644 --- a/product_planned_price/models/product_template.py +++ b/product_planned_price/models/product_template.py @@ -2,9 +2,12 @@ # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## -from odoo import models, fields, api -from odoo.tools import float_is_zero import logging + +from odoo.tools import float_is_zero + +from odoo import api, fields, models + _logger = logging.getLogger(__name__) @@ -94,8 +97,7 @@ def cron_update_prices_from_planned(self, batch_size=1000): self.env.cr.commit() # si setamos last updated es porque todavia quedan por procesar, volvemos a llamar al cron if last_updated_id: - # para obtener el job_id se requiere este PR https://github.com/odoo/odoo/pull/146147 - cron = self.env['ir.cron'].browse(self.env.context.get('job_id')) or self.env.ref('product_planned_price.ir_cron_update_price_from_planned') + cron = self.env.ref('product_planned_price.ir_cron_update_price_from_planned') cron._trigger() def _update_prices_from_planned(self): diff --git a/product_replenishment_cost/models/product_template.py b/product_replenishment_cost/models/product_template.py index 96c94d03d..581c6b269 100644 --- a/product_replenishment_cost/models/product_template.py +++ b/product_replenishment_cost/models/product_template.py @@ -2,10 +2,13 @@ # For copyright and license notices, see __manifest__.py file in module root # directory ############################################################################## -from odoo import models, fields, api, _ -from odoo.tools import float_compare -from odoo.exceptions import ValidationError import logging + +from odoo.exceptions import ValidationError +from odoo.tools import float_compare + +from odoo import _, api, fields, models + _logger = logging.getLogger(__name__) @@ -133,7 +136,6 @@ def cron_update_cost_from_replenishment_cost(self, limit=None, company_ids=None, self.env.cr.commit() # si setamos last updated es porque todavia quedan por procesar, volvemos a llamar al cron if last_updated_id: - # para obtener el job_id se requiere este PR https://github.com/odoo/odoo/pull/146147 cron = self.env.ref('product_replenishment_cost.ir_cron_update_cost_from_replenishment_cost') cron._trigger()