[FIX] _planned_price,_replenishment_cost: change job_id for cron_id#833
[FIX] _planned_price,_replenishment_cost: change job_id for cron_id#833cav-adhoc wants to merge 1 commit intoingadhoc:18.0from
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates two product modules to use the correct context key cron_id instead of the obsolete job_id when retrieving the current cron job. The change aligns with Odoo 19 standards where job_id has been replaced by cron_id in the cron execution context.
Key changes:
- Updated context key from
job_idtocron_idin both product_replenishment_cost and product_planned_price modules - Applied code formatting improvements (multi-line parameter lists) across both files
- Removed outdated comments referencing the old Odoo PR
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| product_replenishment_cost/models/product_template.py | Changed job_id to cron_id in cron retrieval logic and applied formatting improvements |
| product_planned_price/models/product_template.py | Changed job_id to cron_id in cron retrieval logic and applied formatting improvements |
| "UPDATE ir_config_parameter set value = %s where id = %s", | ||
| (str(last_updated_id), last_updated_param.id), |
There was a problem hiding this comment.
Uso de self.env.cr.execute() con query SQL directo. Aunque los parámetros están correctamente parametrizados, se recomienda utilizar el ORM de Odoo siempre que sea posible para mayor seguridad y mantenibilidad. Considera reemplazar con last_updated_param.write({'value': str(last_updated_id)}).
| "UPDATE ir_config_parameter set value = %s where id = %s", | ||
| (str(last_updated_id), last_updated_param.id), |
There was a problem hiding this comment.
Uso de self.env.cr.execute() con query SQL directo. Aunque los parámetros están correctamente parametrizados, se recomienda utilizar el ORM de Odoo siempre que sea posible para mayor seguridad y mantenibilidad. Considera reemplazar con last_updated_param.write({'value': str(last_updated_id)}).
| "UPDATE product_template SET list_price=%s WHERE id=%s", | ||
| (rec.computed_list_price or 0.0, rec.id), |
There was a problem hiding this comment.
Uso de cr.execute() con query SQL directo. Aunque los parámetros están correctamente parametrizados, se recomienda utilizar el ORM de Odoo para mayor seguridad y mantenibilidad. Considera reemplazar con rec.write({'list_price': rec.computed_list_price or 0.0}).

No description provided.