Daily updates from Odoo
Navigate
Branch
Tuesday, August 1, 2023
20 changes
Enhancements to existing features
The private bike benefit field is now shown on employee contracts instead of employee records. This makes the information easier to find and manage in the context of salary and payroll agreements.
Original PR description
*: l10n_be_hr_contract_salary, l10n_be_hr_payroll purpose: to increase visibility of the field task - 3323613
Resolved issues and error corrections
The Planning module installation now updates employee access tokens in a single database operation instead of several repeated ones. This reduces setup time and network overhead, especially when the application and database run on separate servers.
Original PR description
## Description During the installation of the module `planning`, we have an override of `_init_column` for the `employee_token`. We were using the psycopg's `executemany` which is just a syntactical sugar for a loop over an `execute`. So we trigger 1 query (which incurs a network cost when deployed and the database is not on the same machine), currently we have 20 queries. ## Solution We can use SQL syntax: ```sql UPDATE ... SET ... FROM (VALUES ...) WHERE ... ``` which does 1 update for all rows in one go. ## Implementation details We could implement this query directly with a simple execute, but it requires a lot of manual construction with the help of `sql.Composed`, because of necessity to insert manually `sql.Literal` used for the tuples of the `VALUES`. Psycopg2 exposes a function called `execute_values` which is just for this case and makes to code way more legible. --- task-3430406
The partner ledger report now applies selected partner filters as expected. This helps users view accurate ledger information for specific partners instead of seeing all partners regardless of their selection.
Original PR description
## Description of the issue/feature this PR addresses The partner ledger should filter by partner correctly. ## Current behavior before PR The partner filter doesn't work. Even trying to set partners once the report gets loaded with all the partners doesn't work ## Desired behavior after PR is merged A properly working partner ledger. Task ID: 3390576 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
This update corrects how the system identifies records after an internal data model change. It helps prevent errors in manufacturing work order displays by using the supported record identifier.
Original PR description
Since the relational model was rewritten (PR 114024), the record id is no longer present in data by default. The correct way to access the id of a record is to do record.resId.
Code cleanup and technical improvements
This update removes an outdated testing workaround now that key web client areas have moved to the newer framework. It helps keep automated tests simpler and more accurate, with no expected change for end users.
Original PR description
Now that most of the webclient codebase (fields, views, client actions...) has been converted to owl, the legacy extra next tick used in a lot of tests is no longer necessary. This commit removes the helper and its usage. At some places, a real tick was needed, but we didn't see it because of the use of the legacy extra next tick. Part of task~3439226
Several Odoo screens were cleaned up by removing an old setting that is now handled automatically by the platform. This reduces maintenance complexity without changing how users interact with the affected forms.
Original PR description
This option is no longer necessary since [1] as the value is now reloaded by default. [1] odoo/odoo#114024 Part of task~3179751
This update replaces an older translation helper with the current standard one across several Odoo Enterprise apps. It is an internal cleanup that keeps labels and messages translated consistently without changing day-to-day functionality for users.
Original PR description
In a previous commit 8bfa76a, _lt() returns _t(). So, in this commit, all usages of _lt() are replaced by _t(). task-3292454 PR Community : https://github.com/odoo/odoo/pull/130179
This update replaces an older internal translation helper with the current standard across several Odoo apps. It should not change what users see, but it makes the codebase simpler and more consistent for future maintenance.
Original PR description
In a previous commit 8bfa76a, _lt() returns _t(). So, in this commit, all usages of _lt() are replaced by _t(). task-3292454
Miscellaneous changes
Before this commit: When we drag and drop the existing file in the workspace. The file is duplicated. Reason: Before version saas-16.3 'ev.dataTransfer.types' returns types 'Files' only when we drag & drop a new file in the workspace. But from version saas-16.3 the types 'Files' return for both cases. Case 1:- drag & drop a new file Case 2:- drag and drop an existing file. So the existing condition fails which causes an issue. After this commit: Now we check for the key, which
Original PR description
Before this commit: When we drag and drop the existing file in the workspace. The file is duplicated. Reason: Before version saas-16.3 'ev.dataTransfer.types' returns types 'Files' only when we drag & drop a new file in the workspace. But from version saas-16.3 the types 'Files' return for both cases. Case 1:- drag & drop a new file Case 2:- drag and drop an existing file. So the existing condition fails which causes an issue. After this commit: Now we check for the key, which is only present in existing records. As a result, the existing documents are no longer duplicated. Task-3299263 Forward-Port-Of: odoo/enterprise#41236
Before this commit, the company used to get all the report's data, including its QWeb was the one set on the user, regardless of the company set by the companySwitcher component. This was due to the fact that the "allowed_company_ids" key was not passed in the context. After this commit, the current company is used to retrieve the report's data. Forward-Port-Of: odoo/enterprise#44627
Original PR description
Before this commit, the company used to get all the report's data, including its QWeb was the one set on the user, regardless of the company set by the companySwitcher component. This was due to the fact that the "allowed_company_ids" key was not passed in the context. After this commit, the current company is used to retrieve the report's data. Forward-Port-Of: odoo/enterprise#44627
Before this commit, the Studio test asserting the ReportEditor could download the preview of the report with a certain context crashed undeterministically because the overriden reoute in python returned with the wrong parameters, making the client crash. Sometimes that crash did not occur because the browser was already closed. After this commit, we do the assertions in JS, and we don't call the actual download route anymore. fixes runbot-error-23383 Forward-Port-Of: odoo/enterprise#44733
Original PR description
Before this commit, the Studio test asserting the ReportEditor could download the preview of the report with a certain context crashed undeterministically because the overriden reoute in python returned with the wrong parameters, making the client crash. Sometimes that crash did not occur because the browser was already closed. After this commit, we do the assertions in JS, and we don't call the actual download route anymore. fixes runbot-error-23383 Forward-Port-Of: odoo/enterprise#44733
There is a commit in community that changes the way the debug mode works for the web client: it now reads the value in the url instead of the session (but only the web client). So, this means that tours that depend on being in debug mode are no longer working, if they redirect to the `/web` url without adding explicitely the `debug` flag. Forward-Port-Of: odoo/enterprise#44666
Original PR description
There is a commit in community that changes the way the debug mode works for the web client: it now reads the value in the url instead of the session (but only the web client). So, this means that tours that depend on being in debug mode are no longer working, if they redirect to the `/web` url without adding explicitely the `debug` flag. Forward-Port-Of: odoo/enterprise#44666
When there is an Connection error or Server unavailability while fetching data from the Odoo Fin proxy. It will raise logger exception error in terminal. This commit will change logger exception to logger warning. Traceback: ``` gaierror: [Errno -2] Name or service not known File "urllib3/connection.py", line 169, in _new_conn conn = connection.create_connection( File "urllib3/util/connection.py", line 73, in create_connection for res in socket.getaddrinfo(host, port, fa
Original PR description
When there is an Connection error or Server unavailability while fetching data from the Odoo Fin proxy. It will raise logger exception error in terminal. This commit will change logger exception to…
When there is an Connection error or Server unavailability while fetching data from the Odoo Fin proxy.
It will raise logger exception error in terminal.
This commit will change logger exception to logger warning.
Traceback:
```
gaierror: [Errno -2] Name or service not known
File "urllib3/connection.py", line 169, in _new_conn
conn = connection.create_connection(
File "urllib3/util/connection.py", line 73, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "socket.py", line 955, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x7f9f1bf25300>: Failed to establish a new connection: [Errno -2] Name or service not known
File "urllib3/connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "urllib3/connectionpool.py", line 382, in _make_request
self._validate_conn(conn)
File "urllib3/connectionpool.py", line 1012, in _validate_conn
conn.connect()
File "urllib3/connection.py", line 353, in connect
conn = self._new_conn()
File "urllib3/connection.py", line 181, in _new_conn
raise NewConnectionError(
MaxRetryError: HTTPSConnectionPool(host='production-ng.odoofin.com', port=443): Max retries exceeded with url: /proxy/v1/refresh (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9f1bf25300>: Failed to establish a new connection: [Errno -2] Name or service not known'))
File "requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "urllib3/connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "urllib3/util/retry.py", line 574, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
ConnectionError: HTTPSConnectionPool(host='production-ng.odoofin.com', port=443): Max retries exceeded with url: /proxy/v1/refresh (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f9f1bf25300>: Failed to establish a new connection: [Errno -2] Name or service not known'))
File "home/odoo/src/enterprise/saas-16.3/account_online_synchronization/models/account_online.py", line 300, in _fetch_odoo_fin
resp = requests.post(url=endpoint_url, json=data, timeout=timeout, auth=OdooFinAuth(record=self.sudo()))
File "requests/api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "requests/api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "requests/sessions.py", line 544, in request
resp = self.send(prep, **send_kwargs)
File "requests/sessions.py", line 657, in send
r = adapter.send(request, **kwargs)
File "requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
```
sentry-4324586259
Forward-Port-Of: odoo/enterprise#44408Spawn the FieldDynamicPlaceholer in the report editor. Scroll the container. Before this commit, the FieldDynamicPlaceholder stayed at its birth position. This is because the Popover Component synchronizes its position whenever the anchor's document is scrolled. In the reportEditor, the iframe's contents is not scrollable, but the iframe's container is, so no scroll event is fired inside the iframe, and the Popover can't react properly. This commit fixes this by manually firing a scroll e
Original PR description
Spawn the FieldDynamicPlaceholer in the report editor. Scroll the container. Before this commit, the FieldDynamicPlaceholder stayed at its birth position. This is because the Popover Component synchronizes its position whenever the anchor's document is scrolled. In the reportEditor, the iframe's contents is not scrollable, but the iframe's container is, so no scroll event is fired inside the iframe, and the Popover can't react properly. This commit fixes this by manually firing a scroll event in the iframe whenever the container has scrolled Forward-Port-Of: odoo/enterprise#44461
While importing a QR-bill into a customer invoice, the data used to fill the partner_id should be the client of the bill. Instead of being taken from the supplier section, it has been fixed to retrieve data from the client's name. Forward-Port-Of: odoo/enterprise#43890
Original PR description
While importing a QR-bill into a customer invoice, the data used to fill the partner_id should be the client of the bill. Instead of being taken from the supplier section, it has been fixed to retrieve data from the client's name. Forward-Port-Of: odoo/enterprise#43890
Change the color of up and down sortable arrow to make it easier to see when it is active. Forward-Port-Of: odoo/enterprise#44732
Original PR description
Change the color of up and down sortable arrow to make it easier to see when it is active. Forward-Port-Of: odoo/enterprise#44732
When you create and post an asset, we want the analytic to be modifiable. When modified, we want the new analytic distribution to be present on all draft depreciation entries. task-3342649 Forward-Port-Of: odoo/enterprise#42001
Original PR description
When you create and post an asset, we want the analytic to be modifiable. When modified, we want the new analytic distribution to be present on all draft depreciation entries. task-3342649 Forward-Port-Of: odoo/enterprise#42001
Since AccountReportEllipsis is expecting the name props to be a string, we need to force the conversion of the name into a string when calling it. Forward-Port-Of: odoo/enterprise#44743
Original PR description
Since AccountReportEllipsis is expecting the name props to be a string, we need to force the conversion of the name into a string when calling it. Forward-Port-Of: odoo/enterprise#44743
To prevent the ORM from removing the imported journals and accounts we need to set the noupdate flag to True as they now have an xmlid. ``` > select id,name,noupdate,module,model from ir_model_data where module = 'l10n_fr_fec_import' and model = 'account .journal' +-------+------------+----------+--------------------+-----------------+ | id | name | noupdate | module | model | |-------+------------+----------+--------------------+-----------------| | 2201
Original PR description
To prevent the ORM from removing the imported journals and accounts we need to set the noupdate flag to True as they now have an xmlid. ``` > select id,name,noupdate,module,model from ir_model_data…
To prevent the ORM from removing the imported journals and accounts we need to set the noupdate flag to True as they now have an xmlid.
```
> select id,name,noupdate,module,model from ir_model_data where module = 'l10n_fr_fec_import' and model = 'account
.journal'
+-------+------------+----------+--------------------+-----------------+
| id | name | noupdate | module | model |
|-------+------------+----------+--------------------+-----------------|
| 22010 | journal_AC | False | l10n_fr_fec_import | account.journal |
| 22011 | journal_OD | False | l10n_fr_fec_import | account.journal |
| 22012 | journal_BA | False | l10n_fr_fec_import | account.journal |
| 22013 | journal_VE | False | l10n_fr_fec_import | account.journal |
| 22014 | journal_OE | False | l10n_fr_fec_import | account.journal |
+-------+------------+----------+--------------------+-----------------+
```
```
2023-07-25 09:16:32,534 27 INFO db_1045400 odoo.addons.base.models.ir_model: Deleting 15@account.journal (l10n_fr_fec_import.journal_OE)
2023-07-25 09:16:32,565 27 ERROR db_1045400 odoo.sql_db: bad query: DELETE FROM "account_journal" WHERE id IN (15)
ERROR: update or delete on table "account_journal" violates foreign key constraint "account_move_journal_id_fkey" on table "account_move"
DETAIL: Key (id)=(15) is still referenced from table "account_move".
2023-07-25 09:16:32,574 27 WARNING db_1045400 odoo.modules.loading: Transient module states were reset
2023-07-25 09:16:32,575 27 ERROR db_1045400 odoo.modules.registry: Failed to load registry
Traceback (most recent call last):
File "/home/odoo/src/odoo/saas-16.3/odoo/modules/registry.py", line 90, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/home/odoo/src/odoo/saas-16.3/odoo/modules/loading.py", line 538, in load_modules
env['ir.model.data']._process_end(processed_modules)
File "/tmp/tmpyglxlhbn/migrations/base/0.0.0/pre-models-no-model-data-delete.py", line 103, in _process_end
return super(IrModelData, self)._process_end(modules)
File "/home/odoo/src/odoo/saas-16.3/odoo/addons/base/models/ir_model.py", line 2354, in _process_end
self._process_end_unlink_record(record)
File "/home/odoo/src/odoo/saas-16.3/odoo/addons/base/models/ir_model.py", line 2283, in _process_end_unlink_record
record.unlink()
File "/home/odoo/src/enterprise/saas-16.3/account_online_synchronization/models/account_journal.py", line 93, in unlink
return super(AccountJournal, self).unlink()
File "/home/odoo/src/odoo/saas-16.3/addons/account/models/account_journal.py", line 523, in unlink
ret = super(AccountJournal, self).unlink()
File "/home/odoo/src/odoo/saas-16.3/addons/rating/models/mail_thread.py", line 22, in unlink
result = super().unlink()
File "/home/odoo/src/odoo/saas-16.3/addons/mail/models/mail_thread.py", line 327, in unlink
res = super(MailThread, self).unlink()
File "/home/odoo/src/odoo/saas-16.3/addons/mail/models/mail_activity_mixin.py", line 246, in unlink
result = super(MailActivityMixin, self).unlink()
File "/home/odoo/src/odoo/saas-16.3/odoo/models.py", line 3838, in unlink
cr.execute(query, (sub_ids,))
File "/home/odoo/src/odoo/saas-16.3/odoo/sql_db.py", line 319, in execute
res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: update or delete on table "account_journal" violates foreign key constraint "account_move_journal_id_fkey" on table "account_move"
DETAIL: Key (id)=(15) is still referenced from table "account_move".
```
Forward-Port-Of: odoo/enterprise#44677Before this PR the Unrealized report was not time dependent, since it was using the amount_residual whenever you make the payment and filter the report at a certain date, the line could display wrong numbers. Example behavior before the PR: - Make a move at a date (2023-01-20), the rate of the currency change the next day, so the move appears in the report - Make a payment the next month (2023-02-05) - Filter the report at the end of the month (2023-01-31) - The line displayed has wrong n
Original PR description
Before this PR the Unrealized report was not time dependent, since it was using the amount_residual whenever you make the payment and filter the report at a certain date, the line could display wrong…
Before this PR the Unrealized report was not time dependent, since it was using the amount_residual whenever you make the payment and filter the report at a certain date, the line could display wrong numbers. Example behavior before the PR: - Make a move at a date (2023-01-20), the rate of the currency change the next day, so the move appears in the report - Make a payment the next month (2023-02-05) - Filter the report at the end of the month (2023-01-31) - The line displayed has wrong number since the amount residual has changed with the payment So this PR make the report time dependent by using partial reconcile. We have split the query into multiple parts. First we made a temporary table that get the amount_residual and amount_currency at a certain date, the aml id and currency_id for all moves that have a partial. Then we use this temporary table, we add a condition to remove moves that are fully paid at the date. And we will do a union all to get all move that don't have a partial payment at a certain date. Co-authored-by: Florian Gilbert <flg@odoo.com> task-id: 3377112 Forward-Port-Of: odoo/enterprise#44570 Forward-Port-Of: odoo/enterprise#43802