Daily updates from Odoo
Monday, May 8, 2023
7 changes · master
Enhancements to existing features
Several Odoo apps no longer pass an extra setting to open forms in edit mode. This aligns them with the platform's current default behavior, reducing unnecessary configuration without changing expected user workflows.
Original PR description
* approvals, delivery_easypost, helpdesk_mail_plugin, industry_fsm, industry_fsm_report, industry_fsm_sale, quality_control_worksheet, stock_barcode
before this commit, in the context of several actions in python and xml the form_view_initial_mode edit is passed.
eg: 'context': {'form_view_initial_mode': 'edit'}
this is no longer needed as we have form view's are now editable by default.
after this commit, the usage of form_view_initial_mode is removed from the context.Code cleanup and technical improvements
This update standardizes how point-of-sale currency amounts are displayed across affected modules. It reduces duplicated formatting logic and helps keep amounts shown consistently for users, including localized certification flows.
Original PR description
For introduction, check: https://github.com/odoo/odoo/pull/120317 - `format_currency` and `format_currency_no_symbol` are replaced with `formatCurrency` that optionally takes a second parameter indicating use of the currency symbol or not. - `format_round_decimals_currency` is replaced by `formatCurrency` no symbol
Miscellaneous changes
TypeError unsupported operand type(s) for *: 'NoneType' and 'int' is generated because the `None` balance value is calculated with float type when currency_id is not provided. step to reproduce: 1 . Install the `accounting` module 2 . Active multiple currencies from configuration > currencies. 3 . Create one invoice and add items in the invoice lines and confirm it. 4 . Prepare a Bank Reconciliation in which add the foreign currency and fill in the details of the invoice. 5 . And
Original PR description
TypeError unsupported operand type(s) for *: 'NoneType' and 'int' is generated because the `None` balance value is calculated with float type when currency_id is not provided. step to reproduce: 1 .…
TypeError unsupported operand type(s) for *: 'NoneType' and 'int' is generated because the `None` balance value is calculated with float type when currency_id is not provided.
step to reproduce:
1 . Install the `accounting` module
2 . Active multiple currencies from configuration > currencies.
3 . Create one invoice and add items in the invoice lines and confirm it.
4 . Prepare a Bank Reconciliation in which add the foreign currency and fill in
the details of the invoice.
5 . And then open the previously created Bank Reconciliation and remove the
`foreign currency` from its manual operation page.
At that time traceback occurs.
Traceback on sentry :
```
TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'
File "odoo/http.py", line 2109, in __call__
response = request._serve_db()
File "odoo/http.py", line 1692, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1719, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1916, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 709, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 28, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 24, 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 "home/odoo/src/enterprise/saas-16.2/account_accountant/models/bank_rec_widget.py", line 933, in onchange
return super(BankRecWidget, self.with_context(recursive_onchanges=False)).onchange(values, field_name, field_onchange)
File "odoo/models.py", line 6521, in onchange
record._onchange_eval(name, field_onchange[name], result)
File "odoo/models.py", line 6232, in _onchange_eval
method_res = method(self)
File "home/odoo/src/enterprise/saas-16.2/account_accountant/models/bank_rec_widget.py", line 672, in _onchange_todo_command
self._process_todo_command(command_split[0], command_split[1:])
File "home/odoo/src/enterprise/saas-16.2/account_accountant_batch_payment/models/bank_rec_widget.py", line 131, in _process_todo_command
super()._process_todo_command(command_name, command_args)
File "home/odoo/src/enterprise/saas-16.2/account_accountant/models/bank_rec_widget.py", line 627, in _process_todo_command
self._action_trigger_matching_rules()
File "home/odoo/src/enterprise/saas-16.2/sale_account_accountant/models/bank_rec_widget.py", line 15, in _action_trigger_matching_rules
matching = super()._action_trigger_matching_rules()
File "home/odoo/src/enterprise/saas-16.2/account_accountant/models/bank_rec_widget.py", line 1526, in _action_trigger_matching_rules
self._action_select_reconcile_model(reco_model)
File "home/odoo/src/enterprise/saas-16.2/account_accountant/models/bank_rec_widget.py", line 1602, in _action_select_reconcile_model
self.line_ids = [
File "home/odoo/src/enterprise/saas-16.2/account_accountant/models/bank_rec_widget.py", line 1603, in <listcomp>
Command.create(self._lines_widget_prepare_reco_model_write_off_vals(reco_model, x))
File "home/odoo/src/enterprise/saas-16.2/account_accountant/models/bank_rec_widget.py", line 1464, in _lines_widget_prepare_reco_model_write_off_vals
._prepare_counterpart_amounts_using_st_line_rate(self.transaction_currency_id, None, write_off_vals['amount_currency'])['balance']
File "addons/account/models/account_bank_statement_line.py", line 530, in _prepare_counterpart_amounts_using_st_line_rate
journ_amount_currency = journal_currency.round(balance * rate_comp2journal_curr)
```
In this commit, if `form_currency_id` is empty, it will accept `form_amount_currency` as `form_balance`.
sentry - 4079706938
Forward-Port-Of: odoo/enterprise#39973AttributeError 'bool' object has no attribute 'decode'. This issue occurs because the user imports the empty files which have no raw data. steps to reproduce : 1. Install the `Belgium - Import Bank CODA Statements` module 2. Open the accounting module. 3. In the Bank section click on the import statement. 4. Select the empty content file (Any other than the CSV file). Traceback generated. Traceback on sentry : ``` AttributeError: 'bool' object has no attribute 'decode' File "odo
Original PR description
AttributeError 'bool' object has no attribute 'decode'. This issue occurs because the user imports the empty files which have no raw data. steps to reproduce : 1. Install the `Belgium - Import Bank…
AttributeError 'bool' object has no attribute 'decode'. This issue occurs because the user imports the empty files which have no raw data.
steps to reproduce :
1. Install the `Belgium - Import Bank CODA Statements` module
2. Open the accounting module.
3. In the Bank section click on the import statement.
4. Select the empty content file (Any other than the CSV file). Traceback generated.
Traceback on sentry :
```
AttributeError: 'bool' object has no attribute 'decode'
File "odoo/http.py", line 2106, in __call__
response = request._serve_db()
File "odoo/http.py", line 1689, in _serve_db
return service_model.retrying(self._serve_ir_http, self.env)
File "odoo/service/model.py", line 134, in retrying
result = func()
File "odoo/http.py", line 1716, in _serve_ir_http
response = self.dispatcher.dispatch(rule.endpoint, args)
File "odoo/http.py", line 1913, in dispatch
result = self.request.registry['ir.http']._dispatch(endpoint)
File "odoo/addons/base/models/ir_http.py", line 154, in _dispatch
result = endpoint(**request.params)
File "odoo/http.py", line 708, in route_wrapper
result = endpoint(self, *args, **params_ok)
File "addons/web/controllers/dataset.py", line 28, in call_kw
return self._call_kw(model, method, args, kwargs)
File "addons/web/controllers/dataset.py", line 24, 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 "home/odoo/src/enterprise/saas-16.2/l10n_be_soda/models/account_journal.py", line 22, in create_document_from_attachment
return super().create_document_from_attachment(attachment_ids)
File "home/odoo/src/enterprise/saas-16.2/account_bank_statement_import/models/account_journal.py", line 31, in create_document_from_attachment
return journal._import_bank_statement(attachments)
File "home/odoo/src/enterprise/saas-16.2/account_bank_statement_import_csv/models/account_journal.py", line 27, in _import_bank_statement
return super()._import_bank_statement(attachments)
File "home/odoo/src/enterprise/saas-16.2/account_bank_statement_import/models/account_journal.py", line 41, in _import_bank_statement
currency_code, account_number, stmts_vals = self._parse_bank_statement_file(attachment)
File "home/odoo/src/enterprise/saas-16.2/l10n_be_coda/models/account_journal.py", line 346, in _parse_bank_statement_file
record_data = attachment.raw.decode(encoding)
```
In this commit, we will prevent uploading the empty files to the server.
sentry - 4067071325
Forward-Port-Of: odoo/enterprise#40550
Forward-Port-Of: odoo/enterprise#40366The PR odoo/enterprise#38637 moved the application to the hired stage on the contract signature, however if an employee signs a new contract, they will not be linked to their application. task-3236161 Forward-Port-Of: odoo/enterprise#40771
Original PR description
The PR odoo/enterprise#38637 moved the application to the hired stage on the contract signature, however if an employee signs a new contract, they will not be linked to their application. task-3236161 Forward-Port-Of: odoo/enterprise#40771
Currently, the partner VAT listing uses the default computed opening date, which is "Last Month". But in practice, the date range that will almost always be used is "Last Year". This can be frustrating, especially on large databases where the report will take a few seconds to load, only to be able to select the correct date and wait some more to have the desired result. This is why the default opening date will now be set to "Last Year" by default. From @tsb-odoo :  Forward-Port-Of: odoo/enterprise#40750
Before this commit, when scheduling an activity from document inspector, there was the following crash: ``` this.saveRecord is not a function ``` This happens because scheduling an activity necessarily reload the chatter. Chatter is mostly in form view, but in documents the chatter is shown in kanban. `saveRecord` does not exist, as this is a form view-specific feature. This commit solves the issue by not calling `saveRecord` if it doesn't exist. opw-3295227 https://github.com/o
Original PR description
Before this commit, when scheduling an activity from document inspector, there was the following crash: ``` this.saveRecord is not a function ``` This happens because scheduling an activity necessarily reload the chatter. Chatter is mostly in form view, but in documents the chatter is shown in kanban. `saveRecord` does not exist, as this is a form view-specific feature. This commit solves the issue by not calling `saveRecord` if it doesn't exist. opw-3295227 https://github.com/odoo/odoo/pull/120674 Forward-Port-Of: odoo/enterprise#40794 Forward-Port-Of: odoo/enterprise#40775