Monday, January 17, 2022
28 changes · master
Enhancements to existing features
The sales-related enterprise apps were updated to stay compatible with recent changes in the core Odoo platform. This helps rental, field service, stock rental, and timesheet invoicing flows continue working smoothly after the underlying community updates.
Original PR description
COM PR: https://github.com/odoo/odoo/pull/71677
Resolved issues and error corrections
This update corrects how several automated tests determine the application's web address, aligning them with the shared testing framework. It helps keep test results reliable and reduces false failures during development, with no direct change for end users.
Original PR description
Multiple tests were wrongly overriding `base_url` instead of using the `base_url` method of HttpCase.
Code cleanup and technical improvements
This update reorganizes and simplifies the core sales order code to make future improvements easier and safer. It also fixes a few small issues, such as clearer translated warnings and preventing unintended customer changes on sales order lines.
Original PR description
To ease future tasks related to `sale`, this PR cleans up the core code of sale, `sale_order.py` & `sale_order_line.py`:
* Follow guidelines for code organisation (defaults, fields, computes, constraints, onchanges, crud, ...)
* Follow guidelines for methods naming conventions (`_onchange`, `_compute`, ...)
* Make code more readable by splitting up overly long lines
* Remove/simplify useless code
* Related / computed fields are readonly by default
* Stored computed fields are compute_sudo by default
* Fix some little issues found during code review
See dedicated [FIX] commits
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-prMiscellaneous changes
**Steps to follow** - Go to the contact app for example - Export some records with a relational field in the import-compatible xlsx format - Reimport the downloaded file - Odoo can't find matching records with a name False **Cause of the issue** xlsxwriter will write a boolean false value for empty relations **Solution** If a field is relational, write an empty string instead opw-2643705 Forward-Port-Of: odoo/odoo#82771 Forward-Port-Of: odoo/odoo#76685
Original PR description
**Steps to follow** - Go to the contact app for example - Export some records with a relational field in the import-compatible xlsx format - Reimport the downloaded file - Odoo can't find matching records with a name False **Cause of the issue** xlsxwriter will write a boolean false value for empty relations **Solution** If a field is relational, write an empty string instead opw-2643705 Forward-Port-Of: odoo/odoo#82771 Forward-Port-Of: odoo/odoo#76685
The Swiss localization invoice report styling was corrected so the invoice title is properly detected and displayed. This ensures Swiss invoice documents keep the intended layout and presentation for customers.
Original PR description
The title's (S)CSS selector was failing to pick up the invoice title, because it was inside the .swiss_container_v2 while it should be out of that. Previous version, v15 was OK: (but it also included the old layout that had to be removed) https://github.com/odoo/odoo/blob/5bb0afc901135c1c44427bcb4e52803121165105/addons/l10n_ch/static/src/scss/report_swissqr.scss#L12-L25 Ticket link: https://www.odoo.com/web#id=2584899&model=project.task  opw-2584899
This reverts commit 71fc6de02fb2d80ca1ecb4e075b8989e7ca497f7. Somehow a field was added that was supposed to be computed / inverse. Changes were done probably due to manipulations between master and stable. Anyway this is not a bug and we will keep only the master version. Forward-Port-Of: odoo/odoo#82813
Original PR description
This reverts commit 71fc6de02fb2d80ca1ecb4e075b8989e7ca497f7. Somehow a field was added that was supposed to be computed / inverse. Changes were done probably due to manipulations between master and stable. Anyway this is not a bug and we will keep only the master version. Forward-Port-Of: odoo/odoo#82813
If money is withdrawn, we can't tell if it's a transfert to the bank account or if some money has been withdrawn to pay an invoice or some expense. We then assign the suspense account in order for the accountant to go through the reconciliation widget process in order to dispatch/assign the amount to the right account(s). This allows all the accounting process to go smoothly without any needs for the accountant to manually create a miscellaneous entry. Introduced by: PR: https://github.com
Original PR description
If money is withdrawn, we can't tell if it's a transfert to the bank account or if some money has been withdrawn to pay an invoice or some expense. We then assign the suspense account in order for the accountant to go through the reconciliation widget process in order to dispatch/assign the amount to the right account(s). This allows all the accounting process to go smoothly without any needs for the accountant to manually create a miscellaneous entry. Introduced by: PR: https://github.com/odoo/odoo/pull/82123 commit: https://github.com/odoo/odoo/commit/336656e0e9677ccb2f43935b6f267fa83ed153df -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82568
Description of the issue/feature this PR addresses: in version 15, sometimes Google and Microsoft calendar synchronizations break with error: Create/update: a mandatory field is not set. Delete: another model requires the record being deleted. If possible, archive it instead. Model: Calendar Attendee Information (calendar.attendee), Field: Contact (partner_id) This is happening, because when Odoo is syncing an event, it will match attendee with res.partner, if no existing partner is fo
Original PR description
Description of the issue/feature this PR addresses: in version 15, sometimes Google and Microsoft calendar synchronizations break with error: Create/update: a mandatory field is not set. Delete:…
Description of the issue/feature this PR addresses: in version 15, sometimes Google and Microsoft calendar synchronizations break with error: Create/update: a mandatory field is not set. Delete: another model requires the record being deleted. If possible, archive it instead. Model: Calendar Attendee Information (calendar.attendee), Field: Contact (partner_id) This is happening, because when Odoo is syncing an event, it will match attendee with res.partner, if no existing partner is found, a new one will be created unless: - the address matches an existing mail alias ([alias_name]@[mail.catchall.domain]) - the address is invalid (eg. in outlook the email address is sometimes in the form /o=ExchangeLabs/ou=.../cn=Recipients/cn=... In this case we should not try to add the attendee to the odoo event. Current behavior before PR: Error when syncing that the customer can only solve by removing the erroneous attendee or remove the event from their calendar. Desired behavior after PR is merged: if the partner cannot be created we ignore it. opw-2670002 opw-2683889 opw-2702661 opw-2704631 opw-2711907 opw-2720032 opw-2722028 closes #82109 fixes #78678 Co-authored-by: andro19951 Forward-Port-Of: odoo/odoo#82454
Steps to reproduce: - install accounting (account_accountant) - go to invoice - click on "send and print" -> template is not loaded directly Solution: - revert changes of commit #fc5812c327daab4 since the onchange is now called only once OPW-2732687 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82730
Original PR description
Steps to reproduce: - install accounting (account_accountant) - go to invoice - click on "send and print" -> template is not loaded directly Solution: - revert changes of commit #fc5812c327daab4 since the onchange is now called only once OPW-2732687 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82730
Prior this commit, the description field of both project.project and project.task were displayed with the resizable bar and were displayed with a calculated height which prevented to see the whole field. After this commit, the resizable option is set to false which displays the whole field content without the resizable bar. task-2735599 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82685
Original PR description
Prior this commit, the description field of both project.project and project.task were displayed with the resizable bar and were displayed with a calculated height which prevented to see the whole field. After this commit, the resizable option is set to false which displays the whole field content without the resizable bar. task-2735599 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82685
This PR contains two commits cherry-picked from #66924. From #66924 discussions, it is currently blocked because commit 37c3719 uses tools.ormcache and thus awaits al's validation. There are currently two tickets in the support perf pipe that are about slow Accounting Dashboard opening. According to a local benchmark (that can be found below), merging these two commits is sufficient to have a good enough speed-up that would allow to close the two aforementioned tickets. Moreover t
Original PR description
This PR contains two commits cherry-picked from #66924. From #66924 discussions, it is currently blocked because commit 37c3719 uses tools.ormcache and thus awaits al's validation. There are…
This PR contains two commits cherry-picked from #66924. From #66924 discussions, it is currently blocked because commit 37c3719 uses tools.ormcache and thus awaits al's validation. There are currently two tickets in the support perf pipe that are about slow Accounting Dashboard opening. According to a local benchmark (that can be found below), merging these two commits is sufficient to have a good enough speed-up that would allow to close the two aforementioned tickets. Moreover these two commits can be safely deployed to stable. #### speedup Customer DB, 65 cash/bank account_journal, 30k account_bank_statement_line, 330k account_move. - account_journal._get_last_bank_statement (state = "posted") avg time: `119 ms -> 7 ms`. - account_journal_dashboard._kanban_dashboard (33 journals) avg time: `7.5s -> 1.06s`. - Accounting App search_read: `12.20s -> 3.40s`. -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82707
The "Join course" link with additional resources was broken Task-2735494 Forward-Port-Of: odoo/odoo#82751
Original PR description
The "Join course" link with additional resources was broken Task-2735494 Forward-Port-Of: odoo/odoo#82751
Current behavior: When archiving a customer contact, the SO linked to this customer where not shown after clicking sales smart button in company Steps to reproduce: 1. App "Contacts": Have a company and a contact as child of this company. 2. App "Sale": Create a Sale Order for the contact of the company and confirm it. 3. App "Contacts": Archive the contact of the company and switch to the company. 4. App "Contacts": The Smart Button for sale orders says it has one sale order but if you
Original PR description
Current behavior: When archiving a customer contact, the SO linked to this customer where not shown after clicking sales smart button in company Steps to reproduce: 1. App "Contacts": Have a company and a contact as child of this company. 2. App "Sale": Create a Sale Order for the contact of the company and confirm it. 3. App "Contacts": Archive the contact of the company and switch to the company. 4. App "Contacts": The Smart Button for sale orders says it has one sale order but if you click on it NO sale orders will be shown. opw-2735060 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82761
The fix to add an `overflow: hidden` in order to prevent the browser from chaining the scroll create a glitch where the scrollbar disappear when it is overflow: hidden. A new css property exists to specify exactly this behavior (`overscroll-behavior: contain;`). Task-2728791 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82266
Original PR description
The fix to add an `overflow: hidden` in order to prevent the browser from chaining the scroll create a glitch where the scrollbar disappear when it is overflow: hidden. A new css property exists to specify exactly this behavior (`overscroll-behavior: contain;`). Task-2728791 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82266
Task-2728793 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82270
Original PR description
Task-2728793 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82270
Backport of https://github.com/odoo/odoo/pull/77254 Customer reporting slow mass production process that eventually crashes: https://www.odoo.com/web#id=2721168&view_type=form&model=project.task&action=333&active_id=49&menu_id=4720&cids=1 hence this backport. The code has been slightly adjusted, namely the `reserved_uom_qty` has been replaced with `product_uom_qty`. I skipped all the tests and backported only the parts that were necessary for performance increase. Tested on customer's d
Original PR description
Backport of https://github.com/odoo/odoo/pull/77254 Customer reporting slow mass production process that eventually crashes: https://www.odoo.com/web#id=2721168&view_type=form&model=project.task&action=333&active_id=49&menu_id=4720&cids=1 hence this backport. The code has been slightly adjusted, namely the `reserved_uom_qty` has been replaced with `product_uom_qty`. I skipped all the tests and backported only the parts that were necessary for performance increase. Tested on customer's db and confirmed working. Forward-Port-Of: odoo/odoo#82380 Forward-Port-Of: odoo/odoo#82215
- Go to Email Marketing and create a new one - Select any template - In Settings tab, set a Preview Text - Send a test The content of the received test email is a text with the html code of the email body. When sending the test email, the body is retrieved with "render_field" method, which does not return a Markup object but a simple string. Then "_prepend_preview" method prepends preview (Markup) to body (str). opw-2686316 -- I confirm I have signed the CLA and read the PR
Original PR description
- Go to Email Marketing and create a new one - Select any template - In Settings tab, set a Preview Text - Send a test The content of the received test email is a text with the html code of the email body. When sending the test email, the body is retrieved with "render_field" method, which does not return a Markup object but a simple string. Then "_prepend_preview" method prepends preview (Markup) to body (str). opw-2686316 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82748
Steps: - Create an Analytic Account AA - Create an Analytic Default Rule : when Product P > AA - Create a Quotation including P, confirm and invoice Issue: - AA is not set for the invoice line of P Cause: - AA is computed on the invoice line when the product is added, but it is recomputed afterward from cache, where it is None Fix: - Not allow it to be recomputed afterward. opw-2714340 Description of the issue/feature this PR addresses: Current behavior before PR: De
Original PR description
Steps: - Create an Analytic Account AA - Create an Analytic Default Rule : when Product P > AA - Create a Quotation including P, confirm and invoice Issue: - AA is not set for the invoice line of P Cause: - AA is computed on the invoice line when the product is added, but it is recomputed afterward from cache, where it is None Fix: - Not allow it to be recomputed afterward. opw-2714340 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#81995
Wrongly defined in #55525 Fixes #82834 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82870
Original PR description
Wrongly defined in #55525 Fixes #82834 -- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#82870
#### The issue: When creating a fresh DB with demo data, the demo company and customer are created with l10n_latam_identification_type_id set to 'VAT' rather than 'RUC'. This causes a problem when we create an invoice with the demo company and the demo customer and validate it: when the l10n_pe_edi module sends the invoice to the OSE, the OSE responds with the following error code: `1007|El dato ingresado no cumple con el estandar - [...] error: Error Factura (codigo: 1007): 1007 (nodo:
Original PR description
#### The issue: When creating a fresh DB with demo data, the demo company and customer are created with l10n_latam_identification_type_id set to 'VAT' rather than 'RUC'. This causes a problem when we…
#### The issue: When creating a fresh DB with demo data, the demo company and customer are created with l10n_latam_identification_type_id set to 'VAT' rather than 'RUC'. This causes a problem when we create an invoice with the demo company and the demo customer and validate it: when the l10n_pe_edi module sends the invoice to the OSE, the OSE responds with the following error code: `1007|El dato ingresado no cumple con el estandar - [...] error: Error Factura (codigo: 1007): 1007 (nodo: "cbc:ID/schemeID" valor: "0")` #### Some observations on how the issue occurs: Interestingly, when you create a new company or partner using the UI, the `l10n_latam_identification_type_id` is automatically set to 'RUC'. This is ensured by the `ResCompany.create()` and `ResPartner._onchange_country()` methods, see https://github.com/odoo/odoo/blob/f84dbf63b9354a3c577589178a09c3ffb151cba3/addons/l10n_latam_base/models/res_company.py#L10 and https://github.com/odoo/odoo/blob/f84dbf63b9354a3c577589178a09c3ffb151cba3/addons/l10n_latam_base/models/res_partner.py#L25 However, when the demo company is created, the `create()` method is called at the first `<field>` element, which is `name`, and so, `create()` does not set `l10n_latam_identification_type_id`. And because the demo partner is created without the UI, the onchange is not called when the partner's country is set. #### The solution: Therefore it is necessary to explicitly set the `l10n_latam_identification_type_id` for both the demo company and the demo customer. Forward-Port-Of: odoo/odoo#82655
Prior to this commit: - The selector used by the FormHtmlFieldExpanderMixin is the generic one '.o_xxl_form_view .oe_form_field.oe_form_field_html'. This selector, altough valid, could lead to an undesired behavior if another html field is present previously (before the description one) in the view. After this commit: - The '[name="description"] is added to the selector which reduces the possible matches only to the one of the description field. --
Original PR description
Prior to this commit:
- The selector used by the FormHtmlFieldExpanderMixin is the generic one
'.o_xxl_form_view .oe_form_field.oe_form_field_html'. This selector, altough
valid, could lead to an undesired behavior if another html field is present
previously (before the description one) in the view.
After this commit:
- The '[name="description"] is added to the selector which reduces the possible
matches only to the one of the description field.
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#82911…CFDI Introduce by odoo/odoo@5b2eb00 In the payment CFDI, we need to report the payer bank account instead of the receiving one. opw-2523580 Forward-Port-Of: odoo/enterprise#23508
Original PR description
…CFDI Introduce by odoo/odoo@5b2eb00 In the payment CFDI, we need to report the payer bank account instead of the receiving one. opw-2523580 Forward-Port-Of: odoo/enterprise#23508
An extra parenthesis has been added in the test tag which blocks the operation of the runbot Bluid Bug introduced in this commit: https://github.com/odoo/enterprise/pull/23347/commits/995dddbf86e5521ae9f69002ae3e1b6e5e1e2ecf Forward-Port-Of: odoo/enterprise#23547 Forward-Port-Of: odoo/enterprise#23539
Original PR description
An extra parenthesis has been added in the test tag which blocks the operation of the runbot Bluid Bug introduced in this commit: https://github.com/odoo/enterprise/pull/23347/commits/995dddbf86e5521ae9f69002ae3e1b6e5e1e2ecf Forward-Port-Of: odoo/enterprise#23547 Forward-Port-Of: odoo/enterprise#23539
Line weights should only be computed for mexico - this is implied by checking if the delivery guide has been signed and sent to the PAC Forward-Port-Of: odoo/enterprise#23407
Original PR description
Line weights should only be computed for mexico - this is implied by checking if the delivery guide has been signed and sent to the PAC Forward-Port-Of: odoo/enterprise#23407
Purpose ======= Currently the employee can only see the documents in the HR folder. The idea is to allow the employee accessing all his documents, with a filter on the HR folder if it correctly configured on the Document settings TaskID: 2700208 Forward-Port-Of: odoo/enterprise#23500
Original PR description
Purpose ======= Currently the employee can only see the documents in the HR folder. The idea is to allow the employee accessing all his documents, with a filter on the HR folder if it correctly configured on the Document settings TaskID: 2700208 Forward-Port-Of: odoo/enterprise#23500
Steps to reproduce: - From a mobile device select one product. - Click on the button 'More'. - The content of the button is overflowing. Expected behavior: - The button content should be fully inside the button. I removed an unnecessary extra icon padding. opw-2721236 Forward-Port-Of: odoo/enterprise#23243
Original PR description
Steps to reproduce: - From a mobile device select one product. - Click on the button 'More'. - The content of the button is overflowing. Expected behavior: - The button content should be fully inside the button. I removed an unnecessary extra icon padding. opw-2721236 Forward-Port-Of: odoo/enterprise#23243
When trying to Print Product Labels via IoT Printer we got this error: Product model not defined, Please contact your administrator. After some debug, _get_report_values in (odoo/addons/stock/report/product_label_report.py) can't find "active_model" in data (args passed from this file). From this revamp: d9f45ba6941939b3d4b40beb5abbc330be84d695 The way to print label or print label dymo must bu adapted So now with this commit we use the data from the object action to render the docum
Original PR description
When trying to Print Product Labels via IoT Printer we got this error: Product model not defined, Please contact your administrator. After some debug, _get_report_values in (odoo/addons/stock/report/product_label_report.py) can't find "active_model" in data (args passed from this file). From this revamp: d9f45ba6941939b3d4b40beb5abbc330be84d695 The way to print label or print label dymo must bu adapted So now with this commit we use the data from the object action to render the document to print with the IoT Forward-Port-Of: odoo/enterprise#23076
fw-port of odoo/odoo#79251 's test. In 14.0, workorder test were refactored to enterprise in odoo/odoo@ed7012e8fd73d772bab5ecddd7781f888d4661f5 and thus the fw-port must be divided. Forward-Port-Of: odoo/enterprise#23106
Original PR description
fw-port of odoo/odoo#79251 's test. In 14.0, workorder test were refactored to enterprise in odoo/odoo@ed7012e8fd73d772bab5ecddd7781f888d4661f5 and thus the fw-port must be divided. Forward-Port-Of: odoo/enterprise#23106