Daily updates from Odoo
Navigate
Branch
Tuesday, July 25, 2023
16 changes
Enhancements to existing features
Users can now create vendor receipts directly from the Documents app, reducing manual steps when processing supplier paperwork. The option appears only when Purchase Receipts are enabled in Accounting, keeping workflows aligned with company settings.
Original PR description
PURPOSE ------- - User can create the vendor receipt from a document application. SPECIFICATIONS -------------- - Added a new 'vendor receipt' on workflow actions - The action is only visible when the 'Purchase Receipt' feature is enabled from the Accounting app. task-3222420
Resolved issues and error corrections
This fix prevents Odoo Studio from crashing when users navigate from a form to edit a related list that includes contextual field settings. It makes the editing flow more reliable for customized forms with existing related records.
Original PR description
Have a form view like:
```xml
<form>
<field name='product_ids'>
<tree>
<field name="m2o" context="{'context_key': 'value', 'parent': parent.id}" />
</tree>
</field>
</form>
```
In studio, edit this view Form and navigate to edit the X2many List View. (provided that the form's record has at least one record in its X2Many, which has its m2o field set).
Before this commit there was a crash as the new RelationalModel couldn't evaluate the "parent" key in the context.
There was an asymmetry between the list and the form view in this flow, because we did not do exactly the same thing to put "parent" in the context. Namely, in the form view, we pushed that key in the config.context, which, happened to be the same Object as params.context.
This commit is the occasion to harmonize all this and make this flow more robust.Code cleanup and technical improvements
This reorganizes several Point of Sale add-ons so their technical files follow a consistent structure and naming pattern. The change helps teams maintain and update these add-ons more reliably, without changing business features or workflows.
Original PR description
pos*: l10n_cl_edi_pos,l10n_de_pos_cert,l10n_de_pos_res_cert, l10n_mx_edi_pos,pos_hr_mobile,pos_iot,pos_l10n_se,pos_settle_due, The POS has a large number of add-on modules. As such, it is important…
pos*: l10n_cl_edi_pos,l10n_de_pos_cert,l10n_de_pos_res_cert, l10n_mx_edi_pos,pos_hr_mobile,pos_iot,pos_l10n_se,pos_settle_due, The POS has a large number of add-on modules. As such, it is important that they all respect strict guidelines when it comes to file structures. Before, each module had more or less it's own rules when it came to this, apart from the fact that code was mostly organised into `js` and `xml` folders. In this PR, we move to a much more structured approach, in which each module follows the following pattern: src/ |-- app/ <-- the module's own new logic |-- overrides/ | |-- components | | |-- overridden_component_a | | | |-- overridden_component_a.js | | | |-- overridden_component_a.xml | | | |-- overridden_component_a.css | |-- models | | |-- overridden_model.js Apart from the structural changes, this PR introduces changes to file names, such that they respect the default pattern of snake_case naming. In this commit, we move the files. In the following one we make the needed changes in the code, such as adapting imports. Task:
This update removes old compatibility code for legacy app actions in Enterprise web features. It simplifies maintenance and helps keep the interface aligned with the newer platform architecture, with little expected impact for everyday users.
Miscellaneous changes
This commit adapts the spaces and table layouts to maintain concistency with Milk design. Requires: - https://github.com/odoo/odoo/pull/127228 task-3382174 Part of task-3326263 Forward-Port-Of: odoo/enterprise#43596
Original PR description
This commit adapts the spaces and table layouts to maintain concistency with Milk design. Requires: - https://github.com/odoo/odoo/pull/127228 task-3382174 Part of task-3326263 Forward-Port-Of: odoo/enterprise#43596
…jects Before this commit, when a product was configured to create tasks or projects it worked only for the first subscription. When the order was upsell or renewed, it would not generate any new task or project. This commit makes sure that upsell do not generate service objects because the pro-rata could not be handled (50% of a task created) but renewal should definitely create new objects. taskid: 3339544 Forward-Port-Of: odoo/enterprise#44390 Forward-Port-Of: odoo/enterprise#41507
Original PR description
…jects Before this commit, when a product was configured to create tasks or projects it worked only for the first subscription. When the order was upsell or renewed, it would not generate any new task or project. This commit makes sure that upsell do not generate service objects because the pro-rata could not be handled (50% of a task created) but renewal should definitely create new objects. taskid: 3339544 Forward-Port-Of: odoo/enterprise#44390 Forward-Port-Of: odoo/enterprise#41507
The message "Made by Odoo with ❤️" is an informal legend that is being printed in the Payslips PDF, this type of legend is not standard in the odoo's PDF. Also, some companies prefer to remove this tag, this is a PDF that will be sent to the employees that not necessary need to know that the system used in the company is odoo. Forward-Port-Of: odoo/enterprise#44486 Forward-Port-Of: odoo/enterprise#44407
Original PR description
The message "Made by Odoo with ❤️" is an informal legend that is being printed in the Payslips PDF, this type of legend is not standard in the odoo's PDF. Also, some companies prefer to remove this tag, this is a PDF that will be sent to the employees that not necessary need to know that the system used in the company is odoo. Forward-Port-Of: odoo/enterprise#44486 Forward-Port-Of: odoo/enterprise#44407
This commit fixes a really old grammar error in the help message of `message_needaction_counter` field. **Before this commit:** “Number of messages which requires an action” **After:** “Number of messages requiring action” The subject of “require” is “messages”, which is third-person plural, so it can't take the *-s* suffix. Community: https://github.com/odoo/odoo/pull/129468 Forward-Port-Of: odoo/enterprise#44484 Forward-Port-Of: odoo/enterprise#44299
Original PR description
This commit fixes a really old grammar error in the help message of `message_needaction_counter` field. **Before this commit:** “Number of messages which requires an action” **After:** “Number of messages requiring action” The subject of “require” is “messages”, which is third-person plural, so it can't take the *-s* suffix. Community: https://github.com/odoo/odoo/pull/129468 Forward-Port-Of: odoo/enterprise#44484 Forward-Port-Of: odoo/enterprise#44299
This commit removes the `.text-secondary` color set on timesheet timers as it was making the contrast too low. Color is handled by `.h2` It also removes `.fw-bold` as the bold font weight is also handled by `.h2` Before:  After:  ta
Original PR description
This commit removes the `.text-secondary` color set on timesheet timers as it was making the contrast too low. Color is handled by `.h2` It also removes `.fw-bold` as the bold font weight is also handled by `.h2` Before:  After:  task-3423808 part of task-3326263 Forward-Port-Of: odoo/enterprise#44039
Issue: In the General Ledger, when the cash basis option is activated, the 'load more' button might sometimes not appear while it should. It is therefore impossible to visualize the following lines. To reproduce : -Activate cash basis in the settings -Create multiple payments for the same invoice, the same day -Open the General Ledger and activate cash basis -Expand the line of the account corresponding to the invoice you have paid. INFO: To see the load more button, you must have more
Original PR description
Issue: In the General Ledger, when the cash basis option is activated, the 'load more' button might sometimes not appear while it should. It is therefore impossible to visualize the following lines.…
Issue: In the General Ledger, when the cash basis option is activated, the 'load more' button might sometimes not appear while it should. It is therefore impossible to visualize the following lines. To reproduce : -Activate cash basis in the settings -Create multiple payments for the same invoice, the same day -Open the General Ledger and activate cash basis -Expand the line of the account corresponding to the invoice you have paid. INFO: To see the load more button, you must have more data than the 'Load More Limit' option of the General Ledger -The 'load more' button is not displayed if the lines corresponding to the payment are present in the lines generated. This fix has some limitations: - With cash basis, the number of lines displayed at each iteration might not correspond to the 'load more limit', but might be a lower number. This is due to the fact that the shadowing of account move lines groups several lines together if several payments for the same invoice occur the same day. - With cash basis, it is possible that a single line is 'split' in 2 lines if it is reached at the end of a load more iteration and more aml must still be combined with the mentioned line. This rest of the line will be displayed on a new line when pressing the 'load more' button. This fix has the benefit of task-3360233 opw-3325964 Forward-Port-Of: odoo/enterprise#44069 Forward-Port-Of: odoo/enterprise#42692
Before this commit, it was not possible to create mandates for subscriptions without a start_date. Now, if the start_date is not yet set, the current date will be used to created the mandate. task-3322020 Introduced by 78749473806627e54f065576b1ba2a0f5a76a988 Forward-Port-Of: odoo/enterprise#44496
Original PR description
Before this commit, it was not possible to create mandates for subscriptions without a start_date. Now, if the start_date is not yet set, the current date will be used to created the mandate. task-3322020 Introduced by 78749473806627e54f065576b1ba2a0f5a76a988 Forward-Port-Of: odoo/enterprise#44496
Open an invoice Hit 'Add debit move', check 'copy lines', create debit note Traceback opw-3421593 Forward-Port-Of: odoo/enterprise#44438 Forward-Port-Of: odoo/enterprise#44256
Original PR description
Open an invoice Hit 'Add debit move', check 'copy lines', create debit note Traceback opw-3421593 Forward-Port-Of: odoo/enterprise#44438 Forward-Port-Of: odoo/enterprise#44256
## Issue When filtering on rental product with the datepicker for a daterange in a future period, where the rental product *will* be available, but it is not *today* because *all* our quantity is being rented out, the filtering on the `/shop` doesn't return the product in the search result, even if it should be available for reservation, after the return of the rental product. ## Steps to reproduce - Install eCommerce, Rental, Inventory - Duplicate a rental product, disable stock tracking
Original PR description
## Issue When filtering on rental product with the datepicker for a daterange in a future period, where the rental product *will* be available, but it is not *today* because *all* our quantity is…
## Issue When filtering on rental product with the datepicker for a daterange in a future period, where the rental product *will* be available, but it is not *today* because *all* our quantity is being rented out, the filtering on the `/shop` doesn't return the product in the search result, even if it should be available for reservation, after the return of the rental product. ## Steps to reproduce - Install eCommerce, Rental, Inventory - Duplicate a rental product, disable stock tracking and disable the possibility to sell it out of stock, publish the product on the website - Change the quantity on hand for that product to 1 - Create a new rental order and rent the product for a daterange X->Y - Pickup the order (quantity on hand is 0) - On the /shop page, edit the website to add the daterange picker - Search with the daterange picker a daterange Z->W, where Z > Y - Observe that our rental product doesn't show up in the search result, even if it could be rented out at Z->W ## Cause The `_filter_on_available_rental_products` filters out variants that have `qty_available = 0`, without checking that maybe some of them could be in the process of being rented out. ## Fix Extend the filtering to take into account that variants could be in the process of being rented out. ## Affected versions 16.0 up to master --- opw-3414160 Forward-Port-Of: odoo/enterprise#44382
When the schedule action `Payroll: Update data` will run the user will face a value error. Because it will try to update the data file 'hr_contribution_register_data.xml' which is not present in our standard code base. steps to produce: - Install `l10n_ma_hr_payroll`. - Settings > Technical> Automation > Schedule Actions > Payroll: Update data. - Click on Run Manually. Traceback on sentry: ``` FileNotFoundError: File not found: l10n_ma_hr_payroll/data/hr_contribution_register_data.xml
Original PR description
When the schedule action `Payroll: Update data` will run the user will face a value error. Because it will try to update the data file 'hr_contribution_register_data.xml' which is not present in our…
When the schedule action `Payroll: Update data` will run the user will face a value error. Because it will try to update the data file 'hr_contribution_register_data.xml' which is not present in our standard code base.
steps to produce:
- Install `l10n_ma_hr_payroll`.
- Settings > Technical> Automation > Schedule Actions > Payroll: Update data.
- Click on Run Manually.
Traceback on sentry:
```
FileNotFoundError: File not found: l10n_ma_hr_payroll/data/hr_contribution_register_data.xml
File "odoo/tools/safe_eval.py", line 362, in safe_eval
return unsafe_eval(c, globals_dict, locals_dict)
File "ir.actions.server(735,)", line 1, in <module>
File "home/odoo/src/enterprise/saas-16.3/hr_payroll/models/hr_payslip.py", line 1097, in _update_payroll_data
convert_file(self.env, module_name, file_to_update, idref)
File "odoo/tools/convert.py", line 607, in convert_file
with file_open(pathname, 'rb') as fp:
File "odoo/tools/misc.py", line 210, in file_open
path = file_path(name, filter_ext=filter_ext, env=env)
File "odoo/tools/misc.py", line 189, in file_path
raise FileNotFoundError("File not found: " + file_path)
ValueError: <class 'FileNotFoundError'>: "File not found: l10n_ma_hr_payroll/data/hr_contribution_register_data.xml" while evaluating
'model._update_payroll_data()'
File "odoo/addons/base/models/ir_cron.py", line 373, in _callback
self.env['ir.actions.server'].browse(server_action_id).run()
File "odoo/addons/base/models/ir_actions.py", line 702, in run
res = runner(run_self, eval_context=eval_context)
File "addons/website/models/ir_actions_server.py", line 61, in _run_action_code_multi
res = super(ServerAction, self)._run_action_code_multi(eval_context)
File "odoo/addons/base/models/ir_actions.py", line 559, in _run_action_code_multi
safe_eval(self.code.strip(), eval_context, mode="exec", nocopy=True, filename=str(self)) # nocopy allows to return 'action'
File "odoo/tools/safe_eval.py", line 376, in safe_eval
raise ValueError('%s: "%s" while evaluating\n%r' % (ustr(type(e)), ustr(e), expr))
```
After applying this commit user will not face this error when the scheduled action will run.
sentry-4327485063
Forward-Port-Of: odoo/enterprise#44409If there is no 'spreadsheet_data' available then traceback will appear. To reproduce the issue: 1) Install the 'Document' Module 2) Go to the 'Document' App 3) On the left side go to 'Spreadsheet' and create a new spreadsheet if not any. 4) Open any spreadsheet 5) Form the URL change 'spreadsheet_id' any number 1,2,3,4,5 ... etc. Traceback will appear. ```Error: 'bool' object has no attribute 'encode'``` See Traceback:- ``` AttributeError: 'bool' object has no attribute 'e
Original PR description
If there is no 'spreadsheet_data' available then traceback will appear. To reproduce the issue: 1) Install the 'Document' Module 2) Go to the 'Document' App 3) On the left side go to 'Spreadsheet'…
If there is no 'spreadsheet_data' available then traceback will appear.
To reproduce the issue:
1) Install the 'Document' Module
2) Go to the 'Document' App
3) On the left side go to 'Spreadsheet' and create a new spreadsheet if not any.
4) Open any spreadsheet
5) Form the URL change 'spreadsheet_id' any number 1,2,3,4,5 ... etc.
Traceback will appear.
```Error: 'bool' object has no attribute 'encode'```
See Traceback:-
```
AttributeError: 'bool' object has no attribute 'encode'
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 1921, 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 "home/odoo/src/enterprise/saas-16.3/documents_spreadsheet/models/documents_document.py", line 63, in join_spreadsheet_session
data = super().join_spreadsheet_session(share_id, access_token)
File "home/odoo/src/enterprise/saas-16.3/spreadsheet_edition/models/spreadsheet_mixin.py", line 51, in join_spreadsheet_session
"data": spreadsheet_sudo._get_spreadsheet_snapshot(),
File "home/odoo/src/enterprise/saas-16.3/spreadsheet_edition/models/spreadsheet_mixin.py", line 146, in _get_spreadsheet_snapshot
self.spreadsheet_snapshot = base64.b64encode(self.spreadsheet_data.encode())
```
In the '_get_spreadsheet_snapshot' function if 'spreadsheet_data' is not available then traceback will raise:
https://github.com/odoo/enterprise/blob/d5557ce3aad7c4d88fa0cd9ea6836774c0926309/spreadsheet_edition/models/spreadsheet_collaborative_mixin.py#L169
Therefore, in the above use case, applying the condition will check if 'spreadsheet_data' is available and then will 'encode' it, and if 'spreadsheet_snapshot' is not available then will raise `ValidationError`
sentry-4245514442
Forward-Port-Of: odoo/enterprise#44473
Forward-Port-Of: odoo/enterprise#42607This PR mostly adapt reports to changes done in odoo/odoo#129310 (modifying xpath, etc. for inherited reports). General guidelines for adaptations: - include 'demo data' inside the report (e.g. `<span t-field='o.name'>INV/2023/001</span>`) - include div.oe_structure elements in several places - these elements take no space in the printed report if empty, but allow users to 'hook in' several places of the reports - modify the base report layout to include several placeholder blocks (for com
Original PR description
This PR mostly adapt reports to changes done in odoo/odoo#129310 (modifying xpath, etc. for inherited reports). General guidelines for adaptations: - include 'demo data' inside the report (e.g.…
This PR mostly adapt reports to changes done in odoo/odoo#129310 (modifying xpath, etc. for inherited reports). General guidelines for adaptations: - include 'demo data' inside the report (e.g. `<span t-field='o.name'>INV/2023/001</span>`) - include div.oe_structure elements in several places - these elements take no space in the printed report if empty, but allow users to 'hook in' several places of the reports - modify the base report layout to include several placeholder blocks (for company address, etc.) that make it clear what goes where (since demo data are a bit unclear for bigger blocks, like address blocks) - add branching or re-order some t-if/t-else conditional blocks. The report shows the first `t-if` content by default, so it makes sense to have it be 'the default value' (e.g. instead of showing the options table all the time in the editor for a quote report, only show is as a t-else) - the goal is to have the report editor open on a report that looks as much as possible as the default, vanilla version of the report - whenever possible, try to avoid `<t>` nodes insise `table/thead/tbody/tr` nodes, as this is not allowed by the hml spec and browser parser will not agree with those. Since the problem is known, the report editor will convert such tables to div elements (and preserve the layout as much as possible) - but making sure the table is 'correct html' (e.g. by moving qweb directives on legal nodes, like tr or td) will preserve the layout and will also allow users to use the table modification tool of the Odd Editor This is a first pass on 'important' reports. A second pass will come before v17. Forward-Port-Of: odoo/enterprise#44463