Skip to content

Conversation

@cav-adhoc
Copy link
Contributor

No description provided.

Copilot AI review requested due to automatic review settings December 15, 2025 17:54
@roboadhoc
Copy link

Pull request status dashboard

Copy link

Copilot AI left a 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_id to cron_id in 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

Comment on lines +142 to +143
"UPDATE ir_config_parameter set value = %s where id = %s",
(str(last_updated_id), last_updated_param.id),
Copy link

Copilot AI Dec 15, 2025

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)}).

Copilot uses AI. Check for mistakes.
Comment on lines +115 to +116
"UPDATE ir_config_parameter set value = %s where id = %s",
(str(last_updated_id), last_updated_param.id),
Copy link

Copilot AI Dec 15, 2025

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)}).

Copilot uses AI. Check for mistakes.
Comment on lines +145 to +146
"UPDATE product_template SET list_price=%s WHERE id=%s",
(rec.computed_list_price or 0.0, rec.id),
Copy link

Copilot AI Dec 15, 2025

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}).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants