diff --git a/product_replenishment_cost/models/product_template.py b/product_replenishment_cost/models/product_template.py index 6b130b34e..7a2c7c440 100644 --- a/product_replenishment_cost/models/product_template.py +++ b/product_replenishment_cost/models/product_template.py @@ -5,7 +5,6 @@ import logging from odoo import _, api, fields, models -from odoo.exceptions import ValidationError from odoo.tools import float_compare _logger = logging.getLogger(__name__) @@ -44,7 +43,7 @@ class ProductTemplate(models.Model): replenishment_base_cost = fields.Float( digits="Product Price", tracking=True, - help="Replanishment Cost expressed in 'Replenishment Base Cost " "Currency'.", + help="Replanishment Cost expressed in 'Replenishment Base Cost Currency'.", ) replenishment_base_cost_currency_id = fields.Many2one( "res.currency", @@ -111,12 +110,6 @@ def cron_update_cost_from_replenishment_cost(self, limit=None, company_ids=None, tampoco podemos usar get_param porque justamente no se va a refrescar el valor """ - # allow force_company for backward compatibility - force_company = self._context.get("force_company", False) - if force_company and company_ids: - raise ValidationError( - _("The argument 'company_ids' and the key 'force_company' on the context can't be used together") - ) # buscamos cual fue el ultimo registro actualziado parameter_name = "product_replenishment_cost.last_updated_record_id" last_updated_param = self.env["ir.config_parameter"].sudo().search([("key", "=", parameter_name)], limit=1) @@ -126,10 +119,8 @@ def cron_update_cost_from_replenishment_cost(self, limit=None, company_ids=None, domain = [("id", ">", int(last_updated_param.value))] records = self.with_context(prefetch_fields=False).search(domain, order="id asc") - # use company_ids or force_company or search for all companies - if force_company: - company_ids = [force_company] - elif not company_ids: + # use company_ids or search for all companies + if not company_ids: company_ids = self.env["res.company"].search([]).ids for company_id in company_ids: