Daily updates from Odoo
Navigate
Branch
Thursday, June 8, 2023
21 changes
Enhancements to existing features
Updated automated tests to match changes in how accordion items appear inside dropdown menus. This helps keep search favorites, cohort views, and grid views stable and reduces the risk of regressions reaching users.
Original PR description
Task-ID: 3276542 (Part of)
VAT closing entry descriptions and references now include the year for monthly and quarterly periods. This makes tax returns easier to identify and helps avoid confusion between the same month or quarter across different years.
Original PR description
Based on [this task](https://www.odoo.com/web#id=3040211&cids=1&menu_id=4720&action=333&active_id=967&model=project.task&view_type=form) Add year detail for the description / reference of the VAT closing entry Why? Users could get confused between December 2021 and December 2022 or between Q4 2021 and Q4 2022 if it's not explicit. What this changes: Before, the reference of the closing entry is not explicit over the year if the periodicity setting is monthly or quarterly. ex: `Tax return for April` With this, there will be a year detail added for monthly/trimester(quarterly) periodicity. ex: `Tax return for April 2023`
Users can now open documents in a new browser tab from the Documents sharing view. This makes it easier to preview and compare multiple documents at the same time without losing their place.
Original PR description
Allow users to open documents in a new tab so that they can preview multiple documents at one time. Task-3323861
Resolved issues and error corrections
The manufacturing barcode flow now handles repeated scans of the finished product without crashing. This keeps operators working smoothly when increasing produced quantities, even when components are not currently in stock.
Original PR description
To reproduce: -Create a product with a BoM and a barcode; (BOM component must not have stock available) -Go to Barcode > Operations > Manufacturing > New -Scan a first time the final product -> The header line for the production is added; -Scan a second time the final product -> The produced qty increases by 1 and add a line for each component; -Scan a third time the final product -> Traceback TaskId: 3355203
Features or functions removed from Odoo
This update removes use of an outdated comparison style in the product lifecycle management area. It helps keep the system aligned with current platform standards and reduces future maintenance risk, with no expected impact on day-to-day users.
Code cleanup and technical improvements
This update reorganizes JavaScript files across several Odoo Enterprise apps to align their structure with related community code changes. It is an internal cleanup intended to make future maintenance easier without changing day-to-day user workflows.
Original PR description
[REF] mail_enterprise, *: reorganize JS files See community counter-part for more details. Part of task-3265211 https://github.com/odoo/odoo/pull/124168
The Knowledge sidebar has been redesigned to load much faster and update without reloading the whole page, especially for workspaces with many articles. Users also get smoother article moving, clearer drag-and-drop feedback, easier trash access, and fewer sidebar-related errors.
Original PR description
Purpose: -------- Previously, the sidebar was rendered server side. The generated html fragment was sent to the client which appended it into the DOM. This was meant to be temporary since the…
Purpose: -------- Previously, the sidebar was rendered server side. The generated html fragment was sent to the client which appended it into the DOM. This was meant to be temporary since the owlification of the application, and had several flaws (slow, lots of DOM manipulations, no reactivity). This commit introduces a sidebar component that is fully autonomous (other components do not have to force a full reload of the page to update the sidebar). It improves the performances (~0.7s vs >3s to load the home page with +1500 articles in the sidebar), reduces the number of RPCs, remove the need of DOM manipulations and allows for more customization. This commit also introduces a "SortableList" hook, that removes the need of the external Jquery library "NestedSortable", and allows for more freedom concerning the drag&drop behaviour. The revamped sidebar also comes with a few new features and fixes: - The MoveArticleDialog (dialog shown when clicking on the "Move To" button) does not ask for confirmation anymore when moving the article to another category. We consider that the user knows what he is doing when using this button, and he has a visual feedback of what happened since the article which has been moved is the active one, and is therefore highlighted in the sidebar. Moreover, clicking on the "move to" button, clicking on the selection input, clicking on a category, clicking on the "move article" button and clicking on "ok" on the confirmation dialog was a long process to just move the current article. Moving an article using drag&drop in the sidebar still asks for confirmation. - When dragging an article in the sidebar, if the current drop position is not allowed, the position hint is shown in red (for example if one only has read access for the parent under which one tries to place the article). This way, one does not need to drop it and receive an access error to know that the position was not allowed. - Articles in the sidebar can be sent to the trash by dragging them onto the trash manager at the bottom of the sidebar. This makes it easier to delete articles from the form view. - The current article is now always shown when it is present in the sidebar (previously, it was not always the case (when using the "MoveArticleDialog" and moving the article under a folded parent). - Resequencing favorites does not crash anymore if you lost access to one of your favorite articles but did not reload the page to show the change in the sidebar yet. Previously, if you did so, you tried to change the sequence of a restricted article (which raised an access error). Now, restricted articles are filtered out when resequencing favorites. - One cannot change from the sidebar the emoji of an article one just locked (and inversely, one can change the emoji if one just unlocked the article). Previously, you could (not) do it until the sidebar was reloaded. - The "Open the trash" button is now always visible. Previously, if you had a lot of articles, you had to scroll to the bottom of the tree to be able to open the trash. These improvements are not available for the public view (from website_knowledge), which still appends into the DOM the sidebar fragment generated server side. Task-3074123
Point-of-sale template names were standardized across several localization and hardware-related modules. This makes the codebase more consistent and easier to maintain, with no expected change to day-to-day user workflows.
Original PR description
pos*: l10n_de_pos_cert, l10n_mx_edi_pos, pos_iot, pos_l10n_se, pos_preparation_display, pos_settle_due Previously, none of the templates of the pos were namespaced, this means that depending on context, you have to access them differently: in xpath the module prefix is necessary even if the template name itself isn't namespace, but in owl components you cannot use the namespaced version because owl doesn't have the notion of modules. This commit namespaces the component templates of all the pos modules so that it's consistent with the rest of the code base. It also removes some extraneous calls to super.setup() that were leftover and are not necessary for components extending directly owl's base Component. Linked-to: odoo/odoo#124069
This change simplifies how German POS certification data is prepared when closing a session by creating it directly in Python instead of converting it from a template. This reduces the risk of errors and makes the process easier to maintain, with no major expected change for end users.
Original PR description
[REF] l10n_de_pos_cert: replace rendering of json object from the xml Currently, the json object needed to close the session is obtained from an xml template that is transformed in python. This approach is not necessary and is also error prone. In this PR i refactor the code in order to create the object directly in Python Task 3323623
Miscellaneous changes
When a user deletes the hr_salary_rule `House Rent Allowance` which is present in the `hr_payroll_account` module. while the user reloads the demo data of the `hr_payroll_acocunt` module at that time traceback will be generated in the log. Steps to reproduce : 1. Install the `hr_payroll` module. 2. Open the payroll app. 3. Cancel all those pay_slips whose `House Rent Allowance` is in the pay_slip_line. 4. Delete all those pay_slips whose `House Rent Allowance` is in the pay_slip_line. 5.
Original PR description
When a user deletes the hr_salary_rule `House Rent Allowance` which is present in the `hr_payroll_account` module. while the user reloads the demo data of the `hr_payroll_acocunt` module at that time…
When a user deletes the hr_salary_rule `House Rent Allowance` which is present in the `hr_payroll_account` module. while the user reloads the demo data of the `hr_payroll_acocunt` module at that time traceback will be generated in the log.
Steps to reproduce :
1. Install the `hr_payroll` module.
2. Open the payroll app.
3. Cancel all those pay_slips whose `House Rent Allowance` is in the pay_slip_line.
4. Delete all those pay_slips whose `House Rent Allowance` is in the pay_slip_line.
5. Select Configuration > Rules.
6. Delete the `House Rent Allowance` rule in the `hr_salary_rule` model.
7. Install the `hr_payroll_acocunt` module.
8. Install the `l10n_be` module.
9. Traceback will be generated in the log.
Traceback in sentry :
```
NotNullViolation: null value in column "struct_id" of relation "hr_salary_rule" violates not-null constraint
DETAIL: Failing row contains (30, null, 5, null, null, 2, 2, null, 1.0, none, contract.wage, fix, null, null,
# Available variables:
#----------------------
# payslip: objec...,
# Available variables:
..., null, null, null, t, t, f, f, 2023-05-16 10:43:14.682949, 2023-05-16 10:43:14.682949, null, null, f).
File "addons/account/models/chart_template.py", line 198, in _load
self._load_data(self._get_demo_data(company))
File "addons/account/models/chart_template.py", line 444, in _load_data
created_vals[model] = self.with_context(lang='en_US').env[model]._load_records(create_vals)
File "odoo/models.py", line 4467, in _load_records
records = self._load_records_create([data['values'] for data in to_create])
File "odoo/models.py", line 4389, in _load_records_create
return self.create(values)
File "<decorator-gen-348>", line 2, in create
File "odoo/api.py", line 410, in _model_create_multi
return create(self, arg)
File "home/odoo/src/enterprise/saas-16.2/hr_payroll/models/hr_salary_rule.py", line 192, in create
rules = super().create(vals_list)
File "<decorator-gen-10>", line 2, in create
File "odoo/api.py", line 410, in _model_create_multi
return create(self, arg)
File "odoo/models.py", line 4023, in create
records = self._create(data_list)
File "odoo/models.py", line 4226, in _create
cr.execute(
File "odoo/sql_db.py", line 311, in execute
res = self._obj.execute(query, params)
```
Applying this commit will solve this issue.
sentry - 4186952560
Forward-Port-Of: odoo/enterprise#41481When a user deletes the email template `appointment_booked_mail_template` which is present in the data file of the `Appointments` module. Then the user creates a new meeting in online appointments and saves it at that time traceback is generated on the user side and also in the log. Steps to reproduce : 1. Install the appointment module. 2. Open settings > companies > Review All Templates. 3. Delete the `Appointment: Appointment Booked` email template. 4. Open the calendar app. 5. Open a
Original PR description
When a user deletes the email template `appointment_booked_mail_template` which is present in the data file of the `Appointments` module. Then the user creates a new meeting in online appointments…
When a user deletes the email template `appointment_booked_mail_template` which is present in the data file of the `Appointments` module. Then the user creates a new meeting in online appointments and saves it at that time traceback is generated on the user side and also in the log.
Steps to reproduce :
1. Install the appointment module.
2. Open settings > companies > Review All Templates.
3. Delete the `Appointment: Appointment Booked` email template.
4. Open the calendar app.
5. Open an online appointment and select any one appointment.
6. Click on the appointment state button.
7. Open the list view and create one meeting and save it.
8. Traceback generated.
Traceback on sentry :
```
KeyError: ('ir.model.data', <function IrModelData._xmlid_lookup at 0x7f947a63ab90>, 'appointment.appointment_booked_mail_template')
File "odoo/tools/cache.py", line 91, in lookup
r = d[key]
File "<decorator-gen-3>", line 2, in __getitem__
File "odoo/tools/func.py", line 87, in locked
return func(inst, *args, **kwargs)
File "odoo/tools/lru.py", line 34, in __getitem__
a = self.d[obj]
ValueError: External ID not found in the system: appointment.appointment_booked_mail_template
File "odoo/http.py", line 2115, in __call__
response = request._serve_db()
File "odoo/http.py", line 1698, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1725, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1838, in dispatch
return self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 715, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "home/odoo/src/enterprise/saas-16.2/appointment/controllers/appointment.py", line 565, in appointment_form_submit
).sudo().create(
File "<decorator-gen-174>", line 2, in create
File "odoo/api.py", line 409, in _model_create_multi
return create(self, [arg])
File "addons/calendar/models/calendar_event.py", line 470, in create
events = super().create(other_vals)
File "<decorator-gen-122>", line 2, in create
File "odoo/api.py", line 410, in _model_create_multi
return create(self, arg)
File "addons/mail/models/mail_thread.py", line 299, in create
thread._message_track_post_template(changes)
File "addons/mail/models/mail_thread.py", line 644, in _message_track_post_template
templates = self._track_template(changes)
File "home/odoo/src/enterprise/saas-16.2/appointment/models/calendar_event.py", line 83, in _track_template
booked_template = self.env.ref('appointment.appointment_booked_mail_template').sudo()
File "odoo/api.py", line 566, in ref
res_model, res_id = self['ir.model.data']._xmlid_to_res_model_res_id(
File "odoo/addons/base/models/ir_model.py", line 1984, in _xmlid_to_res_model_res_id
return self._xmlid_lookup(xmlid)[1:3]
File "<decorator-gen-40>", line 2, in _xmlid_lookup
File "odoo/tools/cache.py", line 96, in lookup
value = d[key] = self.method(*args, **kwargs)
File "odoo/addons/base/models/ir_model.py", line 1977, in _xmlid_lookup
raise ValueError('External ID not found in the system: %s' % xmlid)
```
Applying this commit will fix this issue.
sentry - 4180359024
Forward-Port-Of: odoo/enterprise#42133
Forward-Port-Of: odoo/enterprise#41172* sale_subscription_dashboard, project_timesheet_synchro before this commit, wrong directories are added by following commit https://github.com/odoo/enterprise/commit/20f01dc1de6933e32749e960e0e8a1b4abd310af after this commit, wrong directories are removed Forward-Port-Of: odoo/enterprise#42035
Original PR description
* sale_subscription_dashboard, project_timesheet_synchro before this commit, wrong directories are added by following commit https://github.com/odoo/enterprise/commit/20f01dc1de6933e32749e960e0e8a1b4abd310af after this commit, wrong directories are removed Forward-Port-Of: odoo/enterprise#42035
Revert the changes introduced in https://github.com/odoo/enterprise/pull/38827 related to the introduction of `@container` (container query), because we want to support Safari on IOS version `>=14` and that feature is only available on `>= 16`. The usage of that container query also introduced some positioning bugs in Kanban embedded views, because with a container, the position is relative to the container and not the viewport. Removing that CSS features also fixe those bugs. Rework
Original PR description
Revert the changes introduced in https://github.com/odoo/enterprise/pull/38827 related to the introduction of `@container` (container query), because we want to support Safari on IOS version `>=14` and that feature is only available on `>= 16`. The usage of that container query also introduced some positioning bugs in Kanban embedded views, because with a container, the position is relative to the container and not the viewport. Removing that CSS features also fixe those bugs. Rework the styling to improve responsiveness of Behavior buttons in a `/table` (`/file` and `/template (clipboard)`). Introduce the BehaviorToolbar component. As we already have 4 blocks in knowledge using the same toolbar style, it becomes interesting to create a generic component, so that style updates in the future are consistent across all blocks. Task-3291771 Forward-Port-Of: odoo/enterprise#40463
In debug mode, props are validated and may cause a client error stack trace. Also, when a component does not specify a static props description, a warning is displayed in the console. This PR fixes or defines props for accounting components Bug reported directly Forward-Port-Of: odoo/enterprise#42107
Original PR description
In debug mode, props are validated and may cause a client error stack trace. Also, when a component does not specify a static props description, a warning is displayed in the console. This PR fixes or defines props for accounting components Bug reported directly Forward-Port-Of: odoo/enterprise#42107
make validation error translatable Forward-Port-Of: odoo/enterprise#42096 Forward-Port-Of: odoo/enterprise#35220
Original PR description
make validation error translatable Forward-Port-Of: odoo/enterprise#42096 Forward-Port-Of: odoo/enterprise#35220
Current behaviour: --- When adding a subscription product to cart, product recurrence is always in english. Steps to reproduce: --- 1. Add French language 2. Go to Subscriptions 3. Open/Create a subscription product 4. Go to website 5. Add product to cart 6. Go to cart 7. Change language to French 8. $ ... par month instead of $ ... par mois Similar fix: https://github.com/odoo/enterprise/commit/25ca586d7f8ed0510f66d3b208055c7fe81806ac opw-3305121 Forward-Port-Of: odoo/enter
Original PR description
Current behaviour: --- When adding a subscription product to cart, product recurrence is always in english. Steps to reproduce: --- 1. Add French language 2. Go to Subscriptions 3. Open/Create a subscription product 4. Go to website 5. Add product to cart 6. Go to cart 7. Change language to French 8. $ ... par month instead of $ ... par mois Similar fix: https://github.com/odoo/enterprise/commit/25ca586d7f8ed0510f66d3b208055c7fe81806ac opw-3305121 Forward-Port-Of: odoo/enterprise#42097 Forward-Port-Of: odoo/enterprise#41425
ValidationError 'You cannot delete a tax line as it would impact the tax report' ,this issue occurs when user add 'taxes' in entries of 'Automatic Transfer' and cron, 'Account automatic transfers : Perform transfers' runs it tries to delete records of account.move.line having 'taxes' value and thus this error is generated in backend. Steps to reproduce: 1) Install 'account_auto_transfer' module. 2) Open 'Accounting' module.. 3) click on 'Accounting' option>'Automatic Transfers'. 4) Click
Original PR description
ValidationError 'You cannot delete a tax line as it would impact the tax report' ,this issue occurs when user add 'taxes' in entries of 'Automatic Transfer' and cron, 'Account automatic transfers :…
ValidationError 'You cannot delete a tax line as it would impact the tax report' ,this issue occurs when user add 'taxes' in entries of 'Automatic Transfer' and cron, 'Account automatic transfers : Perform transfers' runs it tries to delete records of account.move.line having 'taxes' value and thus this error is generated in backend.
Steps to reproduce:
1) Install 'account_auto_transfer' module.
2) Open 'Accounting' module..
3) click on 'Accounting' option>'Automatic Transfers'.
4) Click on 'New' button to create new 'Automatic Transfer'.
5) Give any name and select 'period' > in 'ORIGIN ACCOUNTS' click on
'Add a line' and select any code (ex: 101401 Bank).
6) In 'AUTOMATED TRANSFER', click on 'Add a line' and select
'Destination Account', select any destination account.
7) Now, click on 'Save' button> 'ACTIVATE' button > 'COMPUTE TRANSFER'.
8) Click on 'Transfers' Stat button > and open record having amount in 'Total'.
9) In 'Journal Items' page, select 'tax' for in line.
10) Now, go to 'Scheduled Actions Triggers' and add
'Account automatic transfers : Perform transfers' cron in it and in 'call at'
select current date and when this cron will be triggered, error will be
generated in the backend.
```
ValidationError: Vous ne pouvez pas supprimer une ligne de taxe car cela aurait un impact sur la déclaration de TVA
File "odoo/addons/base/models/ir_cron.py", line 373, in _callback
self.env['ir.actions.server'].browse(server_action_id).run()
File "odoo/addons/base/models/ir_actions.py", line 694, in run
res = runner(run_self, eval_context=eval_context)
File "odoo/addons/base/models/ir_actions.py", line 564, in _run_action_code_multi
raise e.with_traceback(e.__traceback__) from None
File "odoo/addons/base/models/ir_actions.py", line 559, in _run_action_code_multi
safe_eval(self.code.strip(), eval_context, mode="exec", nocopy=True, filename=str(self)) # nocopy allows to return 'action'
File "odoo/tools/safe_eval.py", line 362, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "ir.actions.server(283,)", line 1, in <module>
File "home/odoo/src/enterprise/saas-16.2/account_auto_transfer/models/transfer_model.py", line 115, in action_cron_auto_transfer
self.search([('state', '=', 'in_progress')]).action_perform_auto_transfer()
File "home/odoo/src/enterprise/saas-16.2/account_auto_transfer/models/transfer_model.py", line 130, in action_perform_auto_transfer
record._create_or_update_move_for_period(start_date, next_move_date)
File "home/odoo/src/enterprise/saas-16.2/account_auto_transfer/models/transfer_model.py", line 181, in _create_or_update_move_for_period
current_move.line_ids.unlink()
File "addons/account/models/account_move_line.py", line 1549, in unlink
res = super().unlink()
File "odoo/models.py", line 3609, in unlink
func(self)
File "addons/account/models/account_move_line.py", line 1524, in _prevent_automatic_line_deletion
raise ValidationError(_(
```
By applying this,it will prevent set value of 'Taxes' in Automated Entries.
sentry - 4200665693
Forward-Port-Of: odoo/enterprise#41971
Forward-Port-Of: odoo/enterprise#41391if any tax merged with group of tax then GST rate is wrong like GST 5% with rounding - SGST 2.5 - CGST 2.5 - rounding tax - 0.001 then GST rate is 5.001 but it's must be 5.0 Forward-Port-Of: odoo/enterprise#41905 Forward-Port-Of: odoo/enterprise#41867
Original PR description
if any tax merged with group of tax then GST rate is wrong like GST 5% with rounding - SGST 2.5 - CGST 2.5 - rounding tax - 0.001 then GST rate is 5.001 but it's must be 5.0 Forward-Port-Of: odoo/enterprise#41905 Forward-Port-Of: odoo/enterprise#41867
Sometimes the editView triggered by one test timed out, making the test fail. The method used to investigate was: - dowload the runbot db that had the crash. - put an artificial Promise that would wait x seconds (5 seconds in this case) - reproduce the issue several time by running the test alone from command line several times. - log the time around the call to edit view, this lead to a near 6 seconds for the sole call to edit_view during the add lines operation. - increase the tour's ti
Original PR description
Sometimes the editView triggered by one test timed out, making the test fail. The method used to investigate was: - dowload the runbot db that had the crash. - put an artificial Promise that would wait x seconds (5 seconds in this case) - reproduce the issue several time by running the test alone from command line several times. - log the time around the call to edit view, this lead to a near 6 seconds for the sole call to edit_view during the add lines operation. - increase the tour's timeout in python and on the step in JS to match that number in the next order of magniture. In that case, the add lines timeout is set to 20 seconds, the step for the next edit view to 5 seconds and the global timeout to 30 seconds. Forward-Port-Of: odoo/enterprise#42059 Forward-Port-Of: odoo/enterprise#40490
Before this commit, studio allowed to create a one2many pointing to a not-stored many2one. As mentionned on https://github.com/odoo/odoo/pull/121664, this is really not ideal as the ORM, when resolving the records of the one2many, will return all the records and filter out in python afterwards. This may hinder the performance overall, especially if the many2one is not searchable. Since there is no easy way to determine in studio many2ones that are non-stored but searchable, this commit just
Original PR description
Before this commit, studio allowed to create a one2many pointing to a not-stored many2one. As mentionned on https://github.com/odoo/odoo/pull/121664, this is really not ideal as the ORM, when resolving the records of the one2many, will return all the records and filter out in python afterwards. This may hinder the performance overall, especially if the many2one is not searchable. Since there is no easy way to determine in studio many2ones that are non-stored but searchable, this commit just prevents to add a one2many to a non-stored many2one. opw-3265982 Forward-Port-Of: odoo/enterprise#41995 Forward-Port-Of: odoo/enterprise#41768
Before this commit =================== Missing line separator in header while we open workorder tablet view. After this commit ================== we added the line separator in workorder tablet view. task - 3338509 Forward-Port-Of: odoo/enterprise#41557
Original PR description
Before this commit =================== Missing line separator in header while we open workorder tablet view. After this commit ================== we added the line separator in workorder tablet view. task - 3338509 Forward-Port-Of: odoo/enterprise#41557