Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions product_planned_price/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)


Expand Down Expand Up @@ -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):
Expand Down
10 changes: 6 additions & 4 deletions product_replenishment_cost/models/product_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)


Expand Down Expand Up @@ -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()

Expand Down
Loading