55import logging
66
77from odoo import _ , api , fields , models
8- from odoo .exceptions import ValidationError
98from odoo .tools import float_compare
109
1110_logger = logging .getLogger (__name__ )
@@ -44,7 +43,7 @@ class ProductTemplate(models.Model):
4443 replenishment_base_cost = fields .Float (
4544 digits = "Product Price" ,
4645 tracking = True ,
47- help = "Replanishment Cost expressed in 'Replenishment Base Cost " " Currency'." ,
46+ help = "Replanishment Cost expressed in 'Replenishment Base Cost Currency'." ,
4847 )
4948 replenishment_base_cost_currency_id = fields .Many2one (
5049 "res.currency" ,
@@ -111,12 +110,6 @@ def cron_update_cost_from_replenishment_cost(self, limit=None, company_ids=None,
111110 tampoco podemos usar get_param porque justamente no se va a refrescar el valor
112111 """
113112
114- # allow force_company for backward compatibility
115- force_company = self ._context .get ("force_company" , False )
116- if force_company and company_ids :
117- raise ValidationError (
118- _ ("The argument 'company_ids' and the key 'force_company' on the context can't be used together" )
119- )
120113 # buscamos cual fue el ultimo registro actualziado
121114 parameter_name = "product_replenishment_cost.last_updated_record_id"
122115 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,
126119 domain = [("id" , ">" , int (last_updated_param .value ))]
127120 records = self .with_context (prefetch_fields = False ).search (domain , order = "id asc" )
128121
129- # use company_ids or force_company or search for all companies
130- if force_company :
131- company_ids = [force_company ]
132- elif not company_ids :
122+ # use company_ids or search for all companies
123+ if not company_ids :
133124 company_ids = self .env ["res.company" ].search ([]).ids
134125
135126 for company_id in company_ids :
0 commit comments