Tuesday, October 24, 2023
18 changes · master
Enhancements to existing features
This update standardizes how formatted text is handled inside translated messages across several Enterprise apps. It helps keep translated content displayed correctly and safely while reducing inconsistencies for users in different languages.
Original PR description
The _() method now supports having a Markup as parameter and automatically escape the translation Enterprise part of odoo/odoo#139316
Adds a place to store detailed information about the latest bank connection status. This prepares a follow-up improvement that will show users clearer error messages and help support teams receive the right context when assistance is needed.
Original PR description
The aim of this commit is adding a simple JSON field on account online link model to handle a future flow where we save the last connection state details (if the connection is in error for example) to know what we have to do for the user. We need to implement this flow because the commit (ed7d7486f30e076e6040a2d528a2c4926225bfa9) that adds the new asynchronous flow (by using cron) doesn't handle all the error messages. It means that the user won't see that he/she receives an error and it won't trigger the redirect warning error that allows the user to open a support ticket directly (with useful info for support team). The feature is divided in 2 commits, one to add the freeze dependent things (the new field) and another one to add all the logic. task-3568712
Resolved issues and error corrections
Fixed an issue where reports did not automatically hide zero-value lines when that setting was meant to be enabled by default. This ensures users see cleaner financial reports immediately, without needing to manually reapply the filter.
Original PR description
In pull request https://github.com/odoo/enterprise/pull/45291, we introduced a new feature that allows you to apply a filter on a report, enabling the ability to hide lines with zero values based on certain conditions. With this enhancement, you can now configure the filter to have one of three settings: "enabled by default," "optional," or "never." Prior to this commit, the "enabled by default" setting was not functioning as expected. This issue came from an initial check within the first if statement that evaluated previous options. The problem was that when you initially entered the report, the previous options dict were empty, and so the options is put to false which was not the intended behavior. task: 3568441
Code cleanup and technical improvements
Updated several Odoo screens to use simpler title styling for kanban cards. This reduces unnecessary styling rules behind the scenes, helping keep the interface code lighter without changing business workflows.
Miscellaneous changes
Depending of the type document, the logic that handles the background OCR status check was different, but it shouldn't have been the case. The logic that is implemented for invoices should be used for expenses and resumes as well. See commit fcb7fdf for the reasons behind the cursor commit. Forward-Port-Of: odoo/enterprise#49420
Original PR description
Depending of the type document, the logic that handles the background OCR status check was different, but it shouldn't have been the case. The logic that is implemented for invoices should be used for expenses and resumes as well. See commit fcb7fdf for the reasons behind the cursor commit. Forward-Port-Of: odoo/enterprise#49420
This update modernizes the underlying editor and dialog components so they can be shared across more parts of Odoo, including Website and Studio. Business users should see little direct change, but it supports a more consistent editing experience and reduces duplicated legacy code.
Original PR description
This PR is the counterpart of odoo/odoo#139154 which converts the AceEditor widget to owl. Doing so required to move the ResizablePanel from web_studio to web, s.t. it can be used in website to wrap the newly introduced ResourceEditor.
This will greatly help the support to know why something did or didn't happen, as Amazon sometimes send strange information in the payload, which are not documented. task-3077540 Forward-Port-Of: odoo/enterprise#49395
Original PR description
This will greatly help the support to know why something did or didn't happen, as Amazon sometimes send strange information in the payload, which are not documented. task-3077540 Forward-Port-Of: odoo/enterprise#49395
The tour could fail at this step if the click on the line happened before the sort. You can reproduce it by adding a time.sleep(2) in the python function sort_lines. We just define the line that should be clicked so we're sure the sort has happened. Linked to runbot error 27633, 27819 Forward-Port-Of: odoo/enterprise#49388 Forward-Port-Of: odoo/enterprise#49325
Original PR description
The tour could fail at this step if the click on the line happened before the sort. You can reproduce it by adding a time.sleep(2) in the python function sort_lines. We just define the line that should be clicked so we're sure the sort has happened. Linked to runbot error 27633, 27819 Forward-Port-Of: odoo/enterprise#49388 Forward-Port-Of: odoo/enterprise#49325
This commit's purpose is to fix the display of progress bar in the gantt view. before this commit: When the planning view is grouped by project, the progress bar is not correctly displayed for some project after this commit: The progress bar is now correctly displayed step to reproduce: - go to the project setting - enable the planning option - open the planning app - click on the 'schedule by project' menu The progress bar of project with allocated hours but without any slot on t
Original PR description
This commit's purpose is to fix the display of progress bar in the gantt view. before this commit: When the planning view is grouped by project, the progress bar is not correctly displayed for some…
This commit's purpose is to fix the display of progress bar in the gantt view. before this commit: When the planning view is grouped by project, the progress bar is not correctly displayed for some project after this commit: The progress bar is now correctly displayed step to reproduce: - go to the project setting - enable the planning option - open the planning app - click on the 'schedule by project' menu The progress bar of project with allocated hours but without any slot on the date range of the view is not displayed. solution: update the data send to the js rpc call of the gantt_progress_bar method. detail of the implementation: The dict send to the javascript side is created in the method gantt_progress__bar_project_id of the 'planning.slot' moduel. It used to only use the result of the read_group of the 'planning.slot' to create the return values. It was updated to also take into account the project that were not in the read_group result. task - 3485773 Forward-Port-Of: odoo/enterprise#49183 Forward-Port-Of: odoo/enterprise#46638
When we used to create appointments resources, we called them "table name - floor name", the problem was that table names were often a number. Some applications rely on resources (e.g. Appointments, Scheduling) and because we start with a number, the list of resources looks messy. Now we've changed the name format of the resources created like this: "floor name - table name". Forward-Port-Of: odoo/enterprise#49328
Original PR description
When we used to create appointments resources, we called them "table name - floor name", the problem was that table names were often a number. Some applications rely on resources (e.g. Appointments, Scheduling) and because we start with a number, the list of resources looks messy. Now we've changed the name format of the resources created like this: "floor name - table name". Forward-Port-Of: odoo/enterprise#49328
Before this commit, the clickbot avoid testing modal menus. Now, the clickbot open and closed the modal menus. task-id 3535596 Forward-Port-Of: odoo/enterprise#49316 Forward-Port-Of: odoo/enterprise#49283
Original PR description
Before this commit, the clickbot avoid testing modal menus. Now, the clickbot open and closed the modal menus. task-id 3535596 Forward-Port-Of: odoo/enterprise#49316 Forward-Port-Of: odoo/enterprise#49283
When the user analyzes the "Timesheet and Planning Analysis" pivot report from the project module and adds it to the "Timesheet vs Planning" filter from the Favourites at the time traceback was generated. Steps to reproduce: - Install the "project_timesheet_forecast" module. - Project > Reporting > Timesheet and Planning Analysis - Click on the pivot icon and add it to the "Timesheet vs Planning" filter from the Favourites. - After that, a traceback will be generated. - Error: ValueError
Original PR description
When the user analyzes the "Timesheet and Planning Analysis" pivot report from the project module and adds it to the "Timesheet vs Planning" filter from the Favourites at the time traceback was…
When the user analyzes the "Timesheet and Planning Analysis" pivot report from the project module and adds it to the "Timesheet vs Planning" filter from the Favourites at the time traceback was generated.
Steps to reproduce:
- Install the "project_timesheet_forecast" module.
- Project > Reporting > Timesheet and Planning Analysis
- Click on the pivot icon and add it to the "Timesheet vs Planning" filter from the Favourites.
- After that, a traceback will be generated.
- Error: ValueError: Invalid field 'date' on model 'project.timesheet.forecast.report.analysis'
As per the base code, the "date" invalid field existed in the user-defined filter context, so when the user tried
to analyze the "Timesheet and Planning Analysis" pivot report and add to the "Timesheet vs Planning" filter from
the Favourites at the time, a traceback was generated. The "date" field does not exist in the "project.timesheet.forecast.report.analysis" object, so instead of the "date" field in this filter, We used the "entry_date" field.
Code reference:
https://github.com/odoo/enterprise/blob/91426a8c4cfd26a5b8eadeafaf4687e47b7366e3/project_timesheet_forecast/report/timesheet_forecast_report.py#L16
Sentry Traceback:
```ValueError: Invalid field 'date' on model 'project.timesheet.forecast.report.analysis'
File "odoo/http.py", line 2134, in __call__
response = request._serve_db()
File "odoo/http.py", line 1710, 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 1737, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1938, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "addons/website/models/ir_http.py", line 233, in _dispatch
response = super()._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 191, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 717, 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 457, in call_kw
result = _call_kw_model(method, model, args, kwargs)
File "odoo/api.py", line 430, in _call_kw_model
result = method(recs, *args, **kwargs)
File "home/odoo/src/enterprise/saas-16.4/project_timesheet_forecast/report/timesheet_forecast_report.py", line 144, in read_group
return super().read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
File "odoo/models.py", line 2513, in read_group
raise ValueError(f"Invalid field {field_name!r} on model {self._name!r}")
```
sentry-4410474697
Forward-Port-Of: odoo/enterprise#46203
Forward-Port-Of: odoo/enterprise#46088This fix is necessary for this PR: https://github.com/odoo/odoo/pull/135865 Because the "test_multiple_fsm_task" fails at this line: https://github.com/odoo/enterprise/blob/16.0/industry_fsm_stock/tests/test_fsm_stock.py#L739-L740 When the "action_fsm_validate" function is called, the "qty_delivered" is computed: https://github.com/odoo/enterprise/blob/0025b1295319f69feb70d5cb5ec80acf92d76ec9/industry_fsm_sale/models/project_task.py#L236 https://github.com/odoo/enterprise/blob/21ba5
Original PR description
This fix is necessary for this PR: https://github.com/odoo/odoo/pull/135865 Because the "test_multiple_fsm_task" fails at this line:…
This fix is necessary for this PR: https://github.com/odoo/odoo/pull/135865 Because the "test_multiple_fsm_task" fails at this line: https://github.com/odoo/enterprise/blob/16.0/industry_fsm_stock/tests/test_fsm_stock.py#L739-L740 When the "action_fsm_validate" function is called, the "qty_delivered" is computed: https://github.com/odoo/enterprise/blob/0025b1295319f69feb70d5cb5ec80acf92d76ec9/industry_fsm_sale/models/project_task.py#L236 https://github.com/odoo/enterprise/blob/21ba5cca5107f2ac16e956d669338ecb44622d00/industry_fsm_stock/models/project_task.py#L32 https://github.com/odoo/enterprise/blob/21ba5cca5107f2ac16e956d669338ecb44622d00/industry_fsm_stock/models/project_task.py#L41 However, in the "_compute_qty_delivered" function, since the moves are in the "confirmed" status, the "qty_delivered" is set to 0: https://github.com/odoo/odoo/blob/8a3284685856b6980e3b620abdbbb3e2c79f57c4/addons/sale_stock/models/sale_order.py#L215 But then, this quantity is modified with "so_line.product_uom_qty": https://github.com/odoo/enterprise/blob/21ba5cca5107f2ac16e956d669338ecb44622d00/industry_fsm_stock/models/project_task.py#L65-L66 However, since move lines are created afterward: https://github.com/odoo/enterprise/blob/21ba5cca5107f2ac16e956d669338ecb44622d00/industry_fsm_stock/models/project_task.py#L67 The "qty_delivered" field must be recomputed because it now depends on "qty_done." But since the moves remain in the "confirmed" status, the "qty_delivered" is set to 0, whereas it should remain at 2 **Solution:** Set the "qty_delivered" with "so_line.product_uom_qty" after the creation of move lines. This way, the "compute_qty_delivered" will not be triggered. OPW-3504138 Forward-Port-Of: odoo/enterprise#48500 Forward-Port-Of: odoo/enterprise#48246
Steps to reproduce: - Install Accounting, Sales, Contacts & AvaTax - Setup AvaTax in Accounting settings - Activate CAD currency - Create a CAD pricelist - Create a fiscal position: * Use AvaTax API: checked * Detect Automatically: checked * Country: Canada - Create a Canadian contact: (e.g. Contact X) * Street: 2 Rue des Jardins * City: Quebec * State: Quebec (CA) * ZIP: G1R459 * Country: Canada - Create a product with "[FR] Shipping only common carrier - fob dest
Original PR description
Steps to reproduce: - Install Accounting, Sales, Contacts & AvaTax - Setup AvaTax in Accounting settings - Activate CAD currency - Create a CAD pricelist - Create a fiscal position: * Use AvaTax API:…
Steps to reproduce:
- Install Accounting, Sales, Contacts & AvaTax
- Setup AvaTax in Accounting settings
- Activate CAD currency
- Create a CAD pricelist
- Create a fiscal position:
* Use AvaTax API: checked
* Detect Automatically: checked
* Country: Canada
- Create a Canadian contact: (e.g. Contact X)
* Street: 2 Rue des Jardins
* City: Quebec
* State: Quebec (CA)
* ZIP: G1R459
* Country: Canada
- Create a product with "[FR] Shipping only common carrier - fob destination (backward compatibility)" as Avatax Category. (e.g. Product X)
- Create a SO:
* Customer: Contact X
* Pricelist: CAD pricelist
* Order Lines:
- product: Product X
- Unit Price 100.00
- Save SO
- Click on "COMPUTE TAXES USING AVATAX"
- => 2 taxes are added ("CANADA GST/TPS [CA] (5.0000%)" and "QUEBEC QST/TVQ [QC] (9.9750%)"). The 2nd one is exempted. So the total taxes are 5.00.
- Confirm SO
- Deliver the product if needed
- Create an invoice from SO (Regular invoice)
- Click on "COMPUTE TAXES USING AVATAX"
1st issue:
The total taxes are 14.98, which are different from the taxes computed in SO (i.e. 5.00).
The exempted tax is not exempted in the total taxes of the invoice.
2nd issue:
When checking the tax lines in "Journal Items" tab, we can see that the amounts of the debit/credit columns are not consistent.
For "CANADA GST/TPS [CA] (5.0000%)" tax, the credit has the same value than the absolute value of "Amount in Currency", when the currency rate should be applied.
For "QUEBEC QST/TVQ [QC] (9.9750 %)" tax (that should be exempted), debit and credit are 0, but "Amount in Currency" is not.
Cause:
When checking if the tax should be manually fixed, we are comparing tax line balance with the amount provided by AvaTax.
However, these 2 amounts are not always in the same currency. Also, when fixing the tax amount manually, amount_currency field is not updated and debit/credit fields are updated with the values coming from AvaTax without conversion to the company currency.
opw-3439742
Forward-Port-Of: odoo/enterprise#49292
Forward-Port-Of: odoo/enterprise#48221## Task Description `o-spreadsheet` now allows to insert images in a spreadsheet, and we also allow to export them inside .xlsx file. However, while this works as intended in a standalone o-spreadsheet server, it doens't work correctly in Odoo as the data of the image are not found while we try ton convert the spreadsheet to an xlsx file. This PR aims to simplify the request made to get the binary data of the image file. ## Related Task/PR(s): - https://github.com/odoo/odoo/pull/136774 -
Original PR description
## Task Description `o-spreadsheet` now allows to insert images in a spreadsheet, and we also allow to export them inside .xlsx file. However, while this works as intended in a standalone o-spreadsheet server, it doens't work correctly in Odoo as the data of the image are not found while we try ton convert the spreadsheet to an xlsx file. This PR aims to simplify the request made to get the binary data of the image file. ## Related Task/PR(s): - https://github.com/odoo/odoo/pull/136774 - Task-3524473 Forward-Port-Of: odoo/enterprise#49066 Forward-Port-Of: odoo/enterprise#47928
Steps: - Install sign - Install `FreeSerif` font (with `apt-get install fonts-freefont-ttf` for example) - Use custom font with system parameter key: `sign.use_custom_font` and value: `FreeSerif` - Upload a new pdf in sign module - Add a new item type Selection - Add two options in the previous item one with special chars for example `ąčęėįšųūž` - Click `Sign now` - Select a random option in the previously created selection item - Sign In the navigator pdf viewer special chars
Original PR description
Steps: - Install sign - Install `FreeSerif` font (with `apt-get install fonts-freefont-ttf` for example) - Use custom font with system parameter key: `sign.use_custom_font` and value: `FreeSerif` -…
Steps:
- Install sign
- Install `FreeSerif` font (with `apt-get install fonts-freefont-ttf` for example)
- Use custom font with system parameter key: `sign.use_custom_font` and value: `FreeSerif`
- Upload a new pdf in sign module
- Add a new item type Selection
- Add two options in the previous item one with special chars for example `ąčęėįšųūž`
- Click `Sign now`
- Select a random option in the previously created selection item
- Sign In the navigator pdf viewer special chars string is correctly rendered This is not the case in the downloaded document
Cause:
Selection item is rendered using a `Paragraph` (from `reportlab` lib). The problem is this `Paragraph` uses a different stylesheet given by `getSampleStyleSheet()["Normal"]` defined in the `reportlab` lib here
```py
stylesheet.add(ParagraphStyle(name='Normal',
fontName=_baseFontName,
fontSize=10,
leading=12)
)
```
https://github.com/eduardocereto/reportlab/blob/master/src/reportlab/lib/styles.py#L251-L255
but it doesnt use the right font, this commit use a custom `ParagraphStyle` with the right font and size
Forward-Port-Of: odoo/enterprise#49106
Forward-Port-Of: odoo/enterprise#48422A view editor's panel will present the fields that are not yet in the arch for a user to add them in the view via DragAndDrop. It filters out the field in the arch from the fields of the model Before this commit, the fields in the arch were not correctly computed, and may generate inconsistencies. After this commit, this works correctly. Forward-Port-Of: odoo/enterprise#49309
Original PR description
A view editor's panel will present the fields that are not yet in the arch for a user to add them in the view via DragAndDrop. It filters out the field in the arch from the fields of the model Before this commit, the fields in the arch were not correctly computed, and may generate inconsistencies. After this commit, this works correctly. Forward-Port-Of: odoo/enterprise#49309
In the Contract reporting view, we have access to integers fields: - # Departure Employee - # New Employees but this information is just giving us for the employee of a given period that are new or departed, but we have no easy way to know which employee this concerns. If someone wanted to see which employee are new for a given month, there is no easy way from this view => the information is available in the SQL view, but not made available in the model fields. This commit proposes
Original PR description
In the Contract reporting view, we have access to integers fields: - # Departure Employee - # New Employees but this information is just giving us for the employee of a given period that are new or departed, but we have no easy way to know which employee this concerns. If someone wanted to see which employee are new for a given month, there is no easy way from this view => the information is available in the SQL view, but not made available in the model fields. This commit proposes to make the field available, so the information is more easily accessible (eg. you could group by "Date First Contract Started" to get the contract start of the employees). opw-3444718 Forward-Port-Of: odoo/enterprise#46480