Daily updates from Odoo
Wednesday, January 15, 2025
3 changes
2 changes
Code cleanup and technical improvements
Company-related information in the web client is now managed through the existing user profile object instead of a separate company service. This reduces duplicated data handling and makes future maintenance easier across many Odoo apps, with little expected impact on day-to-day users.
Original PR description
This commit aims to simplify the way developers can access company related information in the web client. Before this commit, in components, they had to import the `userService` hook and do something…
This commit aims to simplify the way developers can access company related information in the web client. Before this commit, in components, they had to import the `userService` hook and do something like `this.company = userService("company")` in the setup. In services, they had to explicitly declare the dependency on the company service. In other functions (like helpers), it was a bit painful: the function had to take an env in arguments, which wasn't ideal.
This commit makes it easier to access the company information. The company service has been removed. Instead, we use the existing `user` object which can be imported directly from anywhere. The `user` object was chosen because the company information is all related to the currently logged-in user.
For clarity, the company information has been renamed:
user.allowedCompanies: The list of companies that the user is allowed to log in to. Note that any of the other companies in the following keys will always be in this list.
user.defaultCompany: The default company to log in to, if the cookies are empty.
user.activeCompanies: The list of the companies that the user is currently logged in to
user.activeCompany: The main company that the user is currently logged in to. This is the company displayed in the main navigation bar in the web client.
Note that, something similar has already been done for the `user` service, the `cookie` service, the `router` service, and the `rpc` service.
This commit also allows the `user` object to take ownership of the company related information in the session. The problem before this commit was that there were 2 sources of truth for company related information : the company service and the `session_info`. The information is sent from the server to the client within the page (in `session_info`). Then the company service was built using this information. This means that the developer could access the information in 2 different ways. Now, the `user` object takes the full ownership of these company related keys by removing them from the session after reading them. Note that, something similar is already done for the user related information and for the currencies (see currency.js).
Part-of task-id 3621046
Part-of task-id 4250356
Part-of task-id 2224776The follow-up reminder automation was renamed internally to better match its purpose, making the system easier to maintain. Related tests were updated to reflect how SMS follow-up processing is now triggered, with no expected change for day-to-day users.
Original PR description
- account_followup: rename the cron xmlid ir_cron_follow_up - ~~sale_amazon: lower rate for pickings and orders~~ odoo/odoo#191863 task-2774819
1 change
Code cleanup and technical improvements
Demo records for IoT and self-ordering IoT have been moved from regular data files into dedicated demo files. This keeps sample content separate from operational data, reducing the chance of demo examples being loaded where they are not needed.
Original PR description
Demo data in those modules were in `data/` folder, they are now in the `demo/` one. Tasks: 4399091, 4464497