Monday, July 10, 2023
47 changes · master
Enhancements to existing features
Select menu search fields now use Odoo's standard focus behavior when the menu opens. This keeps the user experience the same while simplifying maintenance and reducing the chance of future inconsistencies.
Original PR description
This commit makes use of the useAutoFocus hook to focus the input when the SelectMenu opens. This usage of the hook can replace the manual focus that was applied when the dropdown opened. The feature can hardly be tested with newer tests, since the behavior is identical, and the focus on the input was already tested.
This update adds missing internal type information in the mail module. It helps developers maintain the messaging code more reliably without changing what users see.
The Knowledge app now restores standard validation checks for its form views after previously incompatible directives were removed. This helps catch invalid view definitions earlier, reducing the risk of future display or stability issues for users.
Original PR description
Now that the forbidden `t-` owl directives have been removed from the arch of the form view of Knowledge, we will re-enable the default arch view validator. That way, we will be able to detect usage of forbidden directives, attributes, etc and prevent potential issues. Follow up of task: 3094058 task-3385229
The signing flow updates the wording shown for recipients when sending signature requests. This makes the message clearer for users preparing documents and helps reduce confusion for recipients.
Original PR description
task-id: 3284359
Resolved issues and error corrections
Checkboxes and toggles now only respond when users click directly on the control itself. This reduces accidental changes caused by clicking nearby empty space, improving reliability in forms and settings.
Original PR description
This commit simply restricts the clickable with of any checkbox component to be restricted to the checkbox (or toggle) itself so that the user can no longer toggle it accidentally from a possibly long range. opw-3378955
Miscellaneous changes
Steps to reproduce: - Drop a Title block in a webpage. - Select text. - Set the text color to a custom gradient. (Not the background color) - Hover a gradient preset. - Leave the gradient preset. gradient color applied on the background. In this PR, Modified the condition which was blocking some mutations from being processed. Before this commit condition got executed successfully on an empty array(`excludedClasses`) too, which should not be. PR:[118872](https://github.com/odoo/
Original PR description
Steps to reproduce: - Drop a Title block in a webpage. - Select text. - Set the text color to a custom gradient. (Not the background color) - Hover a gradient preset. - Leave the gradient preset. gradient color applied on the background. In this PR, Modified the condition which was blocking some mutations from being processed. Before this commit condition got executed successfully on an empty array(`excludedClasses`) too, which should not be. PR:[118872](https://github.com/odoo/odoo/pull/118872) task-3120090 Forward-Port-Of: odoo/odoo#118872
This fixes a validation rule so custom field names must truly start with the required prefix. It prevents incorrectly named fields from being accepted, improving data consistency in the core system.
Original PR description
Oversight in revision 8c38baee8526b725536eac6b6dee04aca92a4aad In SQL, The underscore character ( _ ) represents a single character to match a pattern from a word or string. Meaning `name LIKE 'x_%'` allows names starting by `x`, and not names starting by `x_` as expected. Add the escape in the constraint to enforce starting by `x_` and not just `x`
This fixes an issue in the Planning app where default values were prepared in the wrong format when sending planning-related messages. The change helps prevent incorrect behavior or errors in that workflow, with limited impact beyond this specific setup step.
Original PR description
Companion of https://github.com/odoo/odoo/pull/127718
While creating an invoice if the user chooses a payment term with an early discount, saves the invoice without adding invoice date and tries to preview it or prints it, then the user will face the error. steps to produce: - Create an invoice without entering invoice date, with a payment term having early discount through 'Invoicing > Customers > Invoices'. eg: (Payment Term with early discount: 2/7 Net 30 ) - Now click on 'Preview' to preview the invoice or print the invoice report.
Original PR description
While creating an invoice if the user chooses a payment term with an early discount, saves the invoice without adding invoice date and tries to preview it or prints it, then the user will face the…
While creating an invoice if the user chooses a payment term with an early
discount, saves the invoice without adding invoice date and tries to
preview it or prints it, then the user will face the error.
steps to produce:
- Create an invoice without entering invoice date, with a payment term having
early discount through 'Invoicing > Customers > Invoices'.
eg: (Payment Term with early discount: 2/7 Net 30 )
- Now click on 'Preview' to preview the invoice or print the invoice report.
By following above steps you will be able to produce the error.
```
TypeError: unsupported operand type(s) for +: 'bool' and 'relativedelta'
File "<683>", line 2250, in template_683
File "<683>", line 2232, in template_683_content
File "<683>", line 1916, in template_683_t_call_0
File "addons/account/models/account_move.py", line 1862, in _is_eligible_for_early_payment_discount
and reference_date <= self.invoice_payment_term_id._get_last_discount_date(self.invoice_date)\
File "addons/account/models/account_payment_term.py", line 233, in _get_last_discount_date
return date_ref + relativedelta(days=self.discount_days or 0) if self.early_discount else False
QWebException: Error while render the template
TypeError: unsupported operand type(s) for +: 'bool' and 'relativedelta'
Template: account.report_invoice_document
Path: /t/t/div[2]/div[3]/div[2]/t/div/div/t[1]/td/span[1]
Node: <span t-options="{"widget": "monetary", "display_currency": o.currency_id}" t-out="o.invoice_payment_term_id._get_amount_due_after_discount(o.amount_total, o.amount_tax)"/>
File "odoo/http.py", line 2114, in __call__
response = request._serve_db()
File "odoo/http.py", line 1699, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 133, in retrying
result = func()
File "odoo/http.py", line 1726, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1840, in dispatch
return self.request.registry['ir.http']._dispatch(endpoint)
File "addons/website/models/ir_http.py", line 234, in _dispatch
response = super()._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 190, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 716, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/account/controllers/portal.py", line 121, in portal_my_invoice_detail
return self._show_report(model=invoice_sudo, report_type=report_type, report_ref='account.account_invoices', download=download)
File "addons/portal/controllers/portal.py", line 491, in _show_report
report = getattr(ReportAction, method_name)(report_ref, list(model.ids), data={'report_type': report_type})[0]
File "odoo/addons/base/models/ir_actions_report.py", line 887, in _render_qweb_html
return self._render_template(report.report_name, data), 'html'
File "odoo/addons/base/models/ir_actions_report.py", line 626, in _render_template
return view_obj._render_template(template, values).encode()
File "addons/website/models/ir_ui_view.py", line 440, in _render_template
return super()._render_template(template, values=values)
File "odoo/addons/base/models/ir_ui_view.py", line 2164, in _render_template
return self.env['ir.qweb']._render(template, values)
File "odoo/tools/profiler.py", line 292, in _tracked_method_render
return method_render(self, template, values, **options)
File "odoo/addons/base/models/ir_qweb.py", line 588, in _render
result = ''.join(rendering)
File "<689>", line 90, in template_689
File "<689>", line 72, in template_689_content
File "<689>", line 60, in template_689_t_call_0
File "<683>", line 2256, in template_683
```
sentry-4250888430
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#125193The Debian package is replacing some fonts by a soft link to the Debian packaged ones. The glyphicons-halfings were for bootstrap 3.x which is not used anymore in Odoo, resulting in harmless broken links in the Debian package. Closes odoo/docker#453 Forward-Port-Of: odoo/odoo#125773
Original PR description
The Debian package is replacing some fonts by a soft link to the Debian packaged ones. The glyphicons-halfings were for bootstrap 3.x which is not used anymore in Odoo, resulting in harmless broken links in the Debian package. Closes odoo/docker#453 Forward-Port-Of: odoo/odoo#125773
The unsplash beacon public widget is started before the test assets JS is loaded. Because of this, the approach in [1] fails sporadically. If the result from the `/web_unsplash/get_app_id` RPC is obtained before the test assets JS is loaded, the beacon patch is not applied in time, and the test fails. This commit applies the patch within the actual beacon to avoid this issue. [1]: https://github.com/odoo/odoo/commit/a5abc766424f34074be3ae7a97ad7c6e9583f9c5 runbot-22610 Forward-Por
Original PR description
The unsplash beacon public widget is started before the test assets JS is loaded. Because of this, the approach in [1] fails sporadically. If the result from the `/web_unsplash/get_app_id` RPC is obtained before the test assets JS is loaded, the beacon patch is not applied in time, and the test fails. This commit applies the patch within the actual beacon to avoid this issue. [1]: https://github.com/odoo/odoo/commit/a5abc766424f34074be3ae7a97ad7c6e9583f9c5 runbot-22610 Forward-Port-Of: odoo/odoo#127686 Forward-Port-Of: odoo/odoo#126813
## Current behaviour When creating a new quotation from an FSM task, if we use a template that adds a line that is a service that would have added a task on SO confirmation, no new task is generated. ## Expected behaviour A new task should be created, just like when we add manually the line with service without using a quotation template. ## Steps to reproduce - Install FSM - Activate "Extra Quotations" from Settings - Create a new service that generates a task on SO confirmations -
Original PR description
## Current behaviour When creating a new quotation from an FSM task, if we use a template that adds a line that is a service that would have added a task on SO confirmation, no new task is generated.…
## Current behaviour When creating a new quotation from an FSM task, if we use a template that adds a line that is a service that would have added a task on SO confirmation, no new task is generated. ## Expected behaviour A new task should be created, just like when we add manually the line with service without using a quotation template. ## Steps to reproduce - Install FSM - Activate "Extra Quotations" from Settings - Create a new service that generates a task on SO confirmations - Create a new quotation template, add a line that uses the service we created. - In a FSM task, click on "New Quotation" - Add the template to the quotation and confirm it - Observe there is no Task attached to the SO. No new task was created. ## Reason for the problem When we create a new quotation view the action "New Quotation", we add in the context a key `default_task_id` with the current task that generated the quotation. When we add a template, an onchange is triggered which creates the lines for the SO, and since we have a `default_task_id` in the context, the related task of the new line is set to the task we came from. This prevent subsequently the creation of a task if the service was supposed to generate a new task on SO confirmation. ## Fix Add an override when generating the data used to create the lines when the onchange is triggered, explicitly setting the `task_id` on the line to `False` if the key is in the context and the service would've generated a task. ## Affected versions - 15.0 - saas-15.2 - 16.0 - saas-16.1 - saas-16.2 - saas-16.3 - master --- opw-3360403 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127741 Forward-Port-Of: odoo/odoo#126720
Since odoo/odoo@2b1e2abda3df user need at least 'Account / Billing' access to read payment.transaction, that not the case for most salesman. So for user that don't have 'Account / Billing', this commit do: - compute the 'amount_paid' as superuser (fixing "Generate Payment Link" wizard access errors) - hide "Payment Transaction" smart-button on invoice --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127797
Original PR description
Since odoo/odoo@2b1e2abda3df user need at least 'Account / Billing' access to read payment.transaction, that not the case for most salesman. So for user that don't have 'Account / Billing', this commit do: - compute the 'amount_paid' as superuser (fixing "Generate Payment Link" wizard access errors) - hide "Payment Transaction" smart-button on invoice --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127797
## Description Adds missing index on `project.task` `state`, this field is used in a lot of searches as a search criteria like "open tasks". --- task-3416393 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127803 Forward-Port-Of: odoo/odoo#127768
Original PR description
## Description Adds missing index on `project.task` `state`, this field is used in a lot of searches as a search criteria like "open tasks". --- task-3416393 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127803 Forward-Port-Of: odoo/odoo#127768
This commit change `/report/barcode/?type=` to `/report/barcode/?barcode_type` See https://github.com/odoo/odoo/commit/ee324e8374536cebca4d7302210b07e8f33d3852#diff-8f0bbb50491623995fba965c3d64585c6cbfdbbe519ec95473e472826d253826R1977-R1979 sentry-3965574308 Forward-Port-Of: odoo/odoo#127222
Original PR description
This commit change `/report/barcode/?type=` to `/report/barcode/?barcode_type` See https://github.com/odoo/odoo/commit/ee324e8374536cebca4d7302210b07e8f33d3852#diff-8f0bbb50491623995fba965c3d64585c6cbfdbbe519ec95473e472826d253826R1977-R1979 sentry-3965574308 Forward-Port-Of: odoo/odoo#127222
**Current behavior before PR:** The icon of table menu looks like drag 'n' drop handle. Therefore everyone expect to be able to drag 'n' drop it and expect to reorganise the table structure. **Desired behavior after PR is merged:** Change the icon of table menu from fa-bars to fa-ellipsis-h and fa-ellipsis-v, also made the menu 100% width so it's easier to intuit it's not a drag 'n' drop handle. task-3297710 Forward-Port-Of: odoo/odoo#121744
Original PR description
**Current behavior before PR:** The icon of table menu looks like drag 'n' drop handle. Therefore everyone expect to be able to drag 'n' drop it and expect to reorganise the table structure. **Desired behavior after PR is merged:** Change the icon of table menu from fa-bars to fa-ellipsis-h and fa-ellipsis-v, also made the menu 100% width so it's easier to intuit it's not a drag 'n' drop handle. task-3297710 Forward-Port-Of: odoo/odoo#121744
If user tries to publish or unpublish the forum post from forum posts list view, a traceback will appear. Steps to reproduce the issue: - Install website_forum - Configure website - Go to Website -> site -> Forum Posts - Select any post -> Action -> 'Publish' or 'Unpublish' Traceback: ``` ValueError: Invalid field 'is_published' on model 'forum.post' File "odoo/http.py", line 2123, in __call__ response = request._serve_db() File "odoo/http.py", line 1699, in _serve_db
Original PR description
If user tries to publish or unpublish the forum post from forum posts list view, a traceback will appear. Steps to reproduce the issue: - Install website_forum - Configure website - Go to Website ->…
If user tries to publish or unpublish the forum post from forum posts list view,
a traceback will appear.
Steps to reproduce the issue:
- Install website_forum
- Configure website
- Go to Website -> site -> Forum Posts
- Select any post -> Action -> 'Publish' or 'Unpublish'
Traceback:
```
ValueError: Invalid field 'is_published' on model 'forum.post'
File "odoo/http.py", line 2123, in __call__
response = request._serve_db()
File "odoo/http.py", line 1699, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 133, in retrying
result = func()
File "odoo/http.py", line 1726, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1927, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "addons/website/models/ir_http.py", line 234, in _dispatch
response = super()._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 190, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 716, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 30, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 26, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 461, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "odoo/api.py", line 448, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "addons/website_forum/models/forum_post.py", line 388, in write
res = super(Post, self).write(vals)
File "addons/mail/models/mail_thread.py", line 312, in write
result = super(MailThread, self).write(values)
File "odoo/models.py", line 3943, in write
raise ValueError("Invalid field %r on model %r" % (fname, self._name))
```
https://github.com/odoo/odoo/blob/551685368971161975d64f480e9bec326db8931e/addons/website/static/src/components/views/page_list.js#L69
Here we will receive 'forum.post' in this.props.resModel.
is_published field is not present in the 'forum.post' model,
So it will lead to above traceback.
sentry-4256037237
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#127225
Forward-Port-Of: odoo/odoo#126648When converting a row with items that are supposed to be stretch-aligned we need to set each of its column's height. However this failed when the row contained less than two columns. opw-3371134 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127746
Original PR description
When converting a row with items that are supposed to be stretch-aligned we need to set each of its column's height. However this failed when the row contained less than two columns. opw-3371134 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127746
This commit reduces the vertical padding of `.o_kanban_header` to display more kanban cards at a time in the view vertically task-3412790 part of task-3326263 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127391
Original PR description
This commit reduces the vertical padding of `.o_kanban_header` to display more kanban cards at a time in the view vertically task-3412790 part of task-3326263 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127391
Prior to this commit, the translate button was in uppercase. To maintain consistency with other buttons, this commit changes the button to lowercase. task-3414983 Part of task-3326263 Issue : https://www.awesomescreenshot.com/image/41293470?key=d57bea9cf48606b167b198fae4f1be58 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127635
Original PR description
Prior to this commit, the translate button was in uppercase. To maintain consistency with other buttons, this commit changes the button to lowercase. task-3414983 Part of task-3326263 Issue : https://www.awesomescreenshot.com/image/41293470?key=d57bea9cf48606b167b198fae4f1be58 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127635
Backport of `_get_guest_from_context`. Prevent crash when unexpected (not recordset) values are in the context. Ensure the mere existence of a value (example integer) does not lead to executing flows where an actual guest is expected. task-2819597 Forward-Port-Of: odoo/odoo#127679 Forward-Port-Of: odoo/odoo#125826
Original PR description
Backport of `_get_guest_from_context`. Prevent crash when unexpected (not recordset) values are in the context. Ensure the mere existence of a value (example integer) does not lead to executing flows where an actual guest is expected. task-2819597 Forward-Port-Of: odoo/odoo#127679 Forward-Port-Of: odoo/odoo#125826
The website frontend apps menu list is not working when the user has a `Home Action` defined on his user. The `Home Action` is meant to redirect to the defined action whenever that user is login in. But since the backend menu links on the website have most of the time no `action` defined but just a `menu_id` defined, the `Home Action` will kick in and take over the redirection, the same way as if the user just type `/web` without any params. To solve that, we simply force the `action` of th
Original PR description
The website frontend apps menu list is not working when the user has a `Home Action` defined on his user. The `Home Action` is meant to redirect to the defined action whenever that user is login in.…
The website frontend apps menu list is not working when the user has a `Home Action` defined on his user. The `Home Action` is meant to redirect to the defined action whenever that user is login in. But since the backend menu links on the website have most of the time no `action` defined but just a `menu_id` defined, the `Home Action` will kick in and take over the redirection, the same way as if the user just type `/web` without any params. To solve that, we simply force the `action` of those links (if they don't already have one). This will make sure that the redirect is working as it should for users having a `Home Action` set. --- Technical hints --- There is multiple methods to get the list of menus in Odoo: - `load_web_menus`: called by the web client rpc, calling `load_menus`. If a top/app menu has no action defined on it, it sets the first found action of their children menus to it. It returns the full (flat) list of menus, not only the top/app ones. This method is not ormcached but is calling an ormcached method and just doing some tiny work on the data. - `load_menus_root`: called only by website backend template to add the app list on the website (in the frontend) to jump to the backend. It does not force the action if a menu has no action set on it. It returns only the top/app menus. This method is ormcached. Note that this method seems only used by the website module. - `load_menus`: returns the full (flat) list of menus without a force action This method is ormcached. Fixes https://github.com/odoo/odoo/issues/119971 Forward-Port-Of: odoo/odoo#127512 Forward-Port-Of: odoo/odoo#125801
Forward-Port-Of: odoo/odoo#127600
Original PR description
Forward-Port-Of: odoo/odoo#127600
on Project > MyTasks, if a task is moved to a folded stage, the task is not closed which contradicts the tooltip on `fold` field of the stage, that states : **tasks on a folded stage are considered as closed** the tooltip is modified to be more clear. opw-3382700 Forward-Port-Of: odoo/odoo#127668 Forward-Port-Of: odoo/odoo#127593
Original PR description
on Project > MyTasks, if a task is moved to a folded stage, the task is not closed which contradicts the tooltip on `fold` field of the stage, that states : **tasks on a folded stage are considered as closed** the tooltip is modified to be more clear. opw-3382700 Forward-Port-Of: odoo/odoo#127668 Forward-Port-Of: odoo/odoo#127593
Before this commit, when opening the media dialog, the optimized images would be fetched too. An optimized image is an image related to an original one which received some modification (crop etc). Those optimized images are hidden by default, and can only be shown when toggling the "Show optimized" option, which can be shown only in debug mode. So, fetching those images outside debug mode is: 1. Useless, as we don't do anything with those and never show them 2. Buggy sometimes, as a full
Original PR description
Before this commit, when opening the media dialog, the optimized images would be fetched too. An optimized image is an image related to an original one which received some modification (crop etc).…
Before this commit, when opening the media dialog, the optimized images would be fetched too. An optimized image is an image related to an original one which received some modification (crop etc). Those optimized images are hidden by default, and can only be shown when toggling the "Show optimized" option, which can be shown only in debug mode. So, fetching those images outside debug mode is: 1. Useless, as we don't do anything with those and never show them 2. Buggy sometimes, as a full patch of "Load more" images could be composed of only optimized images, meaning the "load more" will actually look like it did nothing, as all received images are (and will remain) hidden. There is a tiny exception: if the edited image is an optimized one, we still need to fetch it's attachment so we can show this image in the media dialog as selected. This fix thus filter out all the optimized images (except the one from the explained exception) from the `search_read()`. opw-3372811 Forward-Port-Of: odoo/odoo#127799 Forward-Port-Of: odoo/odoo#126817
Steps to reproduce: - On the expense product by default, set an account_id - Upload an expense Issue: The account_id that we set is not the one on the newly created expense Cause: We don't give any account_id during creation. Therefore, the account_id by default is set: https://github.com/odoo/odoo/blob/7bcd64c51b2e87ece462c75a528c9ad6e1601633/addons/hr_expense/models/hr_expense.py#L31-L32 opw-3343007 Forward-Port-Of: odoo/odoo#127641 Forward-Port-Of: odoo/odoo#126825
Original PR description
Steps to reproduce: - On the expense product by default, set an account_id - Upload an expense Issue: The account_id that we set is not the one on the newly created expense Cause: We don't give any account_id during creation. Therefore, the account_id by default is set: https://github.com/odoo/odoo/blob/7bcd64c51b2e87ece462c75a528c9ad6e1601633/addons/hr_expense/models/hr_expense.py#L31-L32 opw-3343007 Forward-Port-Of: odoo/odoo#127641 Forward-Port-Of: odoo/odoo#126825
When the user deletes the certificate of facturae EDI invoices on Spain and tries to send an invoice from the `Send & Print`, button error will be produced says, the local variable 'xml_content' referenced before the assignment. Steps to produce: - Install the 'l10n_es_edi_facturae' module and change the company to ES Company. - Accounting > Configuration > Spain Facturae EDI > Certificates. - Delete all the certificate(s). - Now create one Invoice > Confirm > Send & Print > Click on `Sen
Original PR description
When the user deletes the certificate of facturae EDI invoices on Spain and tries to send an invoice from the `Send & Print`, button error will be produced says, the local variable 'xml_content'…
When the user deletes the certificate of facturae EDI invoices on Spain and tries to send an invoice from the `Send & Print`, button error will be produced says, the local variable 'xml_content' referenced before the assignment.
Steps to produce:
- Install the 'l10n_es_edi_facturae' module and change the company to ES Company.
- Accounting > Configuration > Spain Facturae EDI > Certificates.
- Delete all the certificate(s).
- Now create one Invoice > Confirm > Send & Print > Click on `Send & Print` button from the wizard.
- Error will be produced.
Fix this issue by using the variable `xml_content = b''`. If it fails to get xml_content from the try block, an error will be handled.
Sentry-4265566923
Traceback:
```
UnboundLocalError: local variable 'xml_content' referenced before assignment
File "odoo/http.py", line 2123, in __call__
response = request._serve_db()
File "odoo/http.py", line 1699, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 133, in retrying
result = func()
File "odoo/http.py", line 1726, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1927, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 190, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 716, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 34, in call_button
action = self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 26, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "odoo/api.py", line 461, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "odoo/api.py", line 448, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "addons/account/wizard/account_move_send.py", line 593, in action_send_and_print
self._generate_invoice_documents(moves_data, allow_fallback_pdf=allow_fallback_pdf)
File "addons/account/wizard/account_move_send.py", line 514, in _generate_invoice_documents
form._hook_invoice_document_before_pdf_report_render(invoice, invoice_data)
File "addons/l10n_es_edi_facturae/models/account_move_send.py", line 71, in _hook_invoice_document_before_pdf_report_render
'raw': xml_content,
```
Forward-Port-Of: odoo/odoo#126029To reproduce (on runbot): - as admin, open "Furniture Technical Specifications" course - click on "Add attendees" and select "Joel Willis" and "Send" it - as "Joel Willis" ('portal' user) go to eLearning (/slides) - click on "All Courses" (/slides/all?my=1) - user get a 403 Forbidden error. As `slide.channel.partner` is restricted to only "eLearning / Officer" group, do the subquery as sudo() so that user can filter on it's own courses --- I confirm I have signed the CLA and read
Original PR description
To reproduce (on runbot):
- as admin, open "Furniture Technical Specifications" course
- click on "Add attendees" and select "Joel Willis" and "Send" it
- as "Joel Willis" ('portal' user) go to eLearning (/slides)
- click on "All Courses" (/slides/all?my=1)
- user get a 403 Forbidden error.
As `slide.channel.partner` is restricted to only "eLearning / Officer" group, do the subquery as sudo() so that user can filter on it's own courses
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#127642#### Issue The `_compute_amount_to_invoice` computation wasn't taking into account the fact that invoices have a direction (i.e. either going outbound(+) or coming inbound(-) (cf. `_compute_direction_sign`)). This, in turn, makes the value of `amount_to_invoice` incorrect for sales order with a credit note. #### Solution In `_compute_amount_to_invoice`, multiply the value of `invoice_amount_currency` with the opposite of the `direction_sign` of the invoice, to account for the invoice
Original PR description
#### Issue The `_compute_amount_to_invoice` computation wasn't taking into account the fact that invoices have a direction (i.e. either going outbound(+) or coming inbound(-) (cf. `_compute_direction_sign`)). This, in turn, makes the value of `amount_to_invoice` incorrect for sales order with a credit note. #### Solution In `_compute_amount_to_invoice`, multiply the value of `invoice_amount_currency` with the opposite of the `direction_sign` of the invoice, to account for the invoice direction. opw-3360439 Forward-Port-Of: odoo/odoo#127781 Forward-Port-Of: odoo/odoo#127355
When the cart has a zero amount (because of pricelist, coupons, ...), providers are not loaded nor displayed. Furthermore, if there is no need for delivery (because the cart only contains services), delivery carriers logic is not loaded either. In this case, without carriers nor providers managing the disabling/enabling of the confirmation button (o_payment_submit_button), the base logic handling the T&C checkbox didn't properly enable the button when it should have. opw-3418472 ---
Original PR description
When the cart has a zero amount (because of pricelist, coupons, ...), providers are not loaded nor displayed. Furthermore, if there is no need for delivery (because the cart only contains services), delivery carriers logic is not loaded either. In this case, without carriers nor providers managing the disabling/enabling of the confirmation button (o_payment_submit_button), the base logic handling the T&C checkbox didn't properly enable the button when it should have. opw-3418472 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127880
Ensure to close all connections before setting the flag that prevents any notification (notably the notification to disconnect). task-3392096 Forward-Port-Of: odoo/odoo#126972
Original PR description
Ensure to close all connections before setting the flag that prevents any notification (notably the notification to disconnect). task-3392096 Forward-Port-Of: odoo/odoo#126972
Create an invoice and without saving it: - Add a line - Switch currency Issue: currency change of the move is not propagated to the move line. Not even after saving and confirming the invoice opw-3267497 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127637 Forward-Port-Of: odoo/odoo#1
Original PR description
Create an invoice and without saving it: - Add a line - Switch currency Issue: currency change of the move is not propagated to the move line. Not even after saving and confirming the invoice opw-3267497 Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127637 Forward-Port-Of: odoo/odoo#124887
With the Milk redesign in [1], the possibility to select a website on the filter/search view on our custom list views (e.g. on website.pages) to filter out the ones not related to a website and only keep the ones with a website_id or no website_id (and not shadowed by a website_id one) disappeared. It has been fixed in [2], but in order to prevent future breaks, this commit tests this functionality. task-3355253 [1]: https://github.com/odoo/odoo/commit/caef16ee4e5351142ef04f0279899
Original PR description
With the Milk redesign in [1], the possibility to select a website on the filter/search view on our custom list views (e.g. on website.pages) to filter out the ones not related to a website and only keep the ones with a website_id or no website_id (and not shadowed by a website_id one) disappeared. It has been fixed in [2], but in order to prevent future breaks, this commit tests this functionality. task-3355253 [1]: https://github.com/odoo/odoo/commit/caef16ee4e5351142ef04f02798999ccb38a56bc [2]: https://github.com/odoo/odoo/commit/9237ca777fb9c5e9bda03c2d0dbe0deed8e1b2e5 Forward-Port-Of: odoo/odoo#127133 Forward-Port-Of: odoo/odoo#124839
When deleting a page, `search_url_dependencies` tries to trawl through all models to see if they might have a link to the page being deleted. However if the user invoking that function does not have access to a model with an HTML field, it raises an error. Given pages are managed by website designers which are *not administrators* there is no reason to believe the current user has access to every model in the database (not that even admins do these days). Since `search_url_dependencies` is a
Original PR description
When deleting a page, `search_url_dependencies` tries to trawl through all models to see if they might have a link to the page being deleted. However if the user invoking that function does not have…
When deleting a page, `search_url_dependencies` tries to trawl through all models to see if they might have a link to the page being deleted. However if the user invoking that function does not have access to a model with an HTML field, it raises an error. Given pages are managed by website designers which are *not administrators* there is no reason to believe the current user has access to every model in the database (not that even admins do these days). Since `search_url_dependencies` is a best-effort search anyway, just ignore any model to which the current user doesn't have access. An alternative would be to do the search in sudo mode, but that doesn't seem necessary, and could even be problematic if a match is found: - it might leak information the user should not access (because the record name is returned, as well as the model & field names) - it will trigger further access errors (because links to problematic records are provided, on which the user might want to click) Forward-Port-Of: odoo/odoo#123014
With this update the version of python goes to 3.9.2 In addition, a unique password system has been put in place Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127273
Original PR description
With this update the version of python goes to 3.9.2 In addition, a unique password system has been put in place Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127273
=== ISSUE === If you open the calendar module with an event with attendees, the status button showing if the user accepted the invitation or not is missing a left margin. === AFTER === We add a `ms-1` class to the buttons to space them correctly. task-3389679 part of task-3326263 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127483
Original PR description
=== ISSUE === If you open the calendar module with an event with attendees, the status button showing if the user accepted the invitation or not is missing a left margin. === AFTER === We add a `ms-1` class to the buttons to space them correctly. task-3389679 part of task-3326263 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127483
This commit fixes the style of the close chatter button in the attachment view to match new Milk button design It also fixes a no spacing issue between `.o-mail-Chatter-close` and `.o-mail-Chatter-follow` task-3415853 part of task-3326263 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127724
Original PR description
This commit fixes the style of the close chatter button in the attachment view to match new Milk button design It also fixes a no spacing issue between `.o-mail-Chatter-close` and `.o-mail-Chatter-follow` task-3415853 part of task-3326263 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127724
Steps to reproduce: ------------------- - with timezone "Europe/Brussels" (UTC +02:00); - create an attendance that starts at 1:00 AM; - go to pivot view in Reporting tab. Issue: ------ Attendance appears to be a day early. Cause: ------ When converting a date to UTC for database storage, it's possible that the date may change (due to a large offset or hours close to 00:00). Therefore, when we use `CAST(check_in as DATE)`, we will keep the date that has potentially changed. S
Original PR description
Steps to reproduce: ------------------- - with timezone "Europe/Brussels" (UTC +02:00); - create an attendance that starts at 1:00 AM; - go to pivot view in Reporting tab. Issue: ------ Attendance…
Steps to reproduce: ------------------- - with timezone "Europe/Brussels" (UTC +02:00); - create an attendance that starts at 1:00 AM; - go to pivot view in Reporting tab. Issue: ------ Attendance appears to be a day early. Cause: ------ When converting a date to UTC for database storage, it's possible that the date may change (due to a large offset or hours close to 00:00). Therefore, when we use `CAST(check_in as DATE)`, we will keep the date that has potentially changed. Solution: --------- Use postgresql's `at time zone <timezone_name>` statement to convert the recorded attendance to UTC in the employee's timezone. Note: ----- On an employee's form view, the "Working Hours" field (`resource_calendar_id`) is required. The `resource_calendar_id` field is a Many to One to the `resource.calendar` model. The `resource.calendar` model contains the `tz` field, which is required. As a result, it will always be possible to find an employee's timezone via his calendar resource. Hypothesis: ----------- Attendances are created using the browser's timezone. It is normal to think that the employee's calendar timezone is the same as his browser timezone. opw-3370874 Forward-Port-Of: odoo/odoo#127035
After odoo/odoo@ad40298a9, when a user having access to timesheet app but not to accounting app tries to see his timesheet in list view, and some lines have been invoiced manually, an access error is raised. This commit ensure that user can compute `readonly_timesheet` even when user has no accounting access. opw-3415661 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127697
Original PR description
After odoo/odoo@ad40298a9, when a user having access to timesheet app but not to accounting app tries to see his timesheet in list view, and some lines have been invoiced manually, an access error is raised. This commit ensure that user can compute `readonly_timesheet` even when user has no accounting access. opw-3415661 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#127697
Versions: --------- - saas-16.2+ Steps to reproduce: ------------------- 1. Install KE payroll and accounting module 2. Go to payroll -> Payslips -> all payslips -> New 3. Choose a Kenyan employee and select “Kenya: Regular pay” in structure 4. Click on “Compute sheet” -> User error Issue: ------ A user error is triggered when we try to compute the sheet on the Kenya payroll Cause: ------ The issue happens because the python code for NSSF_EMPLOYEE_TIER_2 salary rule does not
Original PR description
Versions: --------- - saas-16.2+ Steps to reproduce: ------------------- 1. Install KE payroll and accounting module 2. Go to payroll -> Payslips -> all payslips -> New 3. Choose a Kenyan employee and select “Kenya: Regular pay” in structure 4. Click on “Compute sheet” -> User error Issue: ------ A user error is triggered when we try to compute the sheet on the Kenya payroll Cause: ------ The issue happens because the python code for NSSF_EMPLOYEE_TIER_2 salary rule does not assign any value to the variable result when ‘pensionable < lower_limit’ and it is None and we try to cast it to float what is responsible for triggering the error. Solution: --------- To solve this issue, we have to ensure the variable is assigned to any float number In this case, we are initializing ‘result = 0’ OPW-3354361 Forward-Port-Of: odoo/enterprise#43620
Restore the missing `await` that was omitted when adapting VoIP to Discuss refactoring in c33fe997f270a086150b628ab1021e9469e89c02, causing the missed calls counter to show NaN:  Task-3416647. Forward-Port-Of: odoo/enterprise#43854
Original PR description
Restore the missing `await` that was omitted when adapting VoIP to Discuss refactoring in c33fe997f270a086150b628ab1021e9469e89c02, causing the missed calls counter to show NaN:  Task-3416647. Forward-Port-Of: odoo/enterprise#43854
Since odoo/odoo@2b1e2abda3df user need at least 'Account / Billing' access to read payment.transaction, that not the case for most salesman. This fix the forward-port commit odoo/enterprise@ad1b126ba to ensure that a user without 'Account / Billing' can still confirm a sale order. Forward-Port-Of: odoo/enterprise#43817
Original PR description
Since odoo/odoo@2b1e2abda3df user need at least 'Account / Billing' access to read payment.transaction, that not the case for most salesman. This fix the forward-port commit odoo/enterprise@ad1b126ba to ensure that a user without 'Account / Billing' can still confirm a sale order. Forward-Port-Of: odoo/enterprise#43817
Steps: - Install project app. - From gantt view plan the existing task at a date where other task is already planned Issue: -It should open the task confirm schedule wizard but gives traceback 'this is undefined'. Cause: - After converting gantt view in OWL. Fix: - bind 'this' from 'openPlanDialogCallback' method calling. task-3268923 Forward-Port-Of: odoo/enterprise#40523
Original PR description
Steps: - Install project app. - From gantt view plan the existing task at a date where other task is already planned Issue: -It should open the task confirm schedule wizard but gives traceback 'this is undefined'. Cause: - After converting gantt view in OWL. Fix: - bind 'this' from 'openPlanDialogCallback' method calling. task-3268923 Forward-Port-Of: odoo/enterprise#40523
Bugfix. Before this commit, if an account had several account tags set on it (e.g. account.account_tag_operating + a non-cash-flow tag), the amounts in the cash flow report would be wrong. #### How to reproduce - Install the Belgian localization, go to Settings -> Chart of Accounts -> 700200 Sales rendered for export -> Set Up. Create a new account tag on the account. - Create a €100 invoice for Deco Addict and register payment. - Open the Cash Flow Statement. You'll see a line for €200 un
Original PR description
Bugfix. Before this commit, if an account had several account tags set on it (e.g. account.account_tag_operating + a non-cash-flow tag), the amounts in the cash flow report would be wrong. #### How to reproduce - Install the Belgian localization, go to Settings -> Chart of Accounts -> 700200 Sales rendered for export -> Set Up. Create a new account tag on the account. - Create a €100 invoice for Deco Addict and register payment. - Open the Cash Flow Statement. You'll see a line for €200 under Cash received from operating activities. #### Expected behaviour - The line should stay at €100 regardless of the new account tag, since it has nothing to do with the Cash Flow Statement. Forward-Port-Of: odoo/enterprise#43811 Forward-Port-Of: odoo/enterprise#43456
Prior to this commit, the background of `o_workorder_tablet_form` was white due to the inheritance of `o_form_nosheet`. The content, which was also white, was not visible. This commit fixes this issue by removing the white background for the `o_workorder_tablet_form`. Before : https://www.awesomescreenshot.com/image/41269320?key=f1961cb17961ac6c7e7eaee3f820bc0a After:  task-3414400 Part of task-3326263 Forward-Port-Of: odoo/enterprise#43733
Steps to reproduce ================== - Go to documents - Switch to the list view - Drag&drop a document (pdf, ...) from a file manager onto the odoo window -> `Invalid handler (expected a function, received: 'undefined')` Cause of the issue ================== Since commit [0], the DocumentListRenderer doesn't extend the DocumentsRendererMixin. This is now handled by the DocumentsDropZone component. Solution ======== Remove the on-drop event handler from the list renderer.
Original PR description
Steps to reproduce ================== - Go to documents - Switch to the list view - Drag&drop a document (pdf, ...) from a file manager onto the odoo window -> `Invalid handler (expected a function, received: 'undefined')` Cause of the issue ================== Since commit [0], the DocumentListRenderer doesn't extend the DocumentsRendererMixin. This is now handled by the DocumentsDropZone component. Solution ======== Remove the on-drop event handler from the list renderer. [0]: 093852117b0b0c912d840b989e46d5ea27d25ebb opw-3295225 Forward-Port-Of: odoo/enterprise#43719 Forward-Port-Of: odoo/enterprise#43188
The DTE attachment is currently using the model fetchmail.server with the res_id of the journal entry when creating the DTE attachment. This will causes issues downloading it on V16.2 resulting in an empty datas.html file. This commit update the model to use account.move model. It targets V14 to avoid the issues after upgrading. opw-3360656 Forward-Port-Of: odoo/enterprise#43808
Original PR description
The DTE attachment is currently using the model fetchmail.server with the res_id of the journal entry when creating the DTE attachment. This will causes issues downloading it on V16.2 resulting in an empty datas.html file. This commit update the model to use account.move model. It targets V14 to avoid the issues after upgrading. opw-3360656 Forward-Port-Of: odoo/enterprise#43808