Conversation
Merge pull request #19 from mapiolca/main
…eek-avec-multicompany feat: compatibilité Multicompany pour TimesheetWeek
Merge pull request #22 from mapiolca/main
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| $sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."timesheet_week_line"; | ||
| $sql .= " WHERE fk_timesheet_week=".(int) $this->id; | ||
| // EN: Protect the fetch to ensure lines belong to an allowed entity scope. | ||
| // FR: Protège le chargement pour s'assurer que les lignes appartiennent à une entité autorisée. | ||
| $sql .= " AND entity IN (".getEntity('timesheetweek').")"; |
There was a problem hiding this comment.
Filtering lines by entity hides pre-existing data
The new fetchLines() clause now restricts rows to entity IN (getEntity('timesheetweek')). Prior to this commit, timesheet lines were inserted without filling the entity column (see previous code), so historical data created in another entity still carries the default value 1. After deployment, fetching a sheet from a shared entity will no longer load any of its existing lines and related actions (submit, totals, etc.) will fail because those rows are filtered out. A data migration or a backward‑compatible filter is needed before this check is applied.
Useful? React with 👍 / 👎.
No description provided.