-
Notifications
You must be signed in to change notification settings - Fork 102
[FIX] _planned_price,_replenishment_cost: change job_id for cron_id #833
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 18.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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), |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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), |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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), |
Copilot
AI
Dec 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.