Friday, January 24, 2025
24 changes · saas-17.2
Resolved issues and error corrections
This fix restores the system's ability to recognize cancelled time off records when checking related resource availability. It helps avoid incorrect scheduling or leave calculations caused by cancelled entries being treated improperly.
Original PR description
In https://github.com/odoo/odoo/pull/127877, the active field was removed and replaced with state: cancel. This domain was modified but removed the check for the cancelled state. opw-4420347
Miscellaneous changes
**Steps to reproduce:** - Install stock_barcode and Sales - In Inventory settings, enable "Multi-Step Routes" - Go to "Inventory / Configuration / Warehouse Management / Routes" - Configure the rule of "Deliver in 1 step (ship)": * Propagation of Procurement Group: Fixed * Fixed Procurement Group: [create a new one] - Create a product tracked by lot - Update the quantity (e.g. 100) of the created product and assign it to a lot - Create a SO for a customer with the created product -
Original PR description
**Steps to reproduce:** - Install stock_barcode and Sales - In Inventory settings, enable "Multi-Step Routes" - Go to "Inventory / Configuration / Warehouse Management / Routes" - Configure the rule…
**Steps to reproduce:** - Install stock_barcode and Sales - In Inventory settings, enable "Multi-Step Routes" - Go to "Inventory / Configuration / Warehouse Management / Routes" - Configure the rule of "Deliver in 1 step (ship)": * Propagation of Procurement Group: Fixed * Fixed Procurement Group: [create a new one] - Create a product tracked by lot - Update the quantity (e.g. 100) of the created product and assign it to a lot - Create a SO for a customer with the created product - Confirm the SO - Create another SO for the same customer with the same product => A delivery order should be created with 2 operations with the same product - Open the delivery order in Barcode - Scan the source location - Select the 2nd line - Scan the lot **Issue:** The first line is incremented instead of the second one. Even when all the products for the first line will be scanned, it will not be possible to scan the lot to increment the second line. **Cause:** The selected line is not taken into account when searching the line on which the scanned lot should be applied. **Solution:** Unshift the selected line to the first position of the array of lines to prioritize it when searching for the adequate line for a scanned lot. opw-4208612 Forward-Port-Of: odoo/enterprise#77700 Forward-Port-Of: odoo/enterprise#76713
Following a discussion with the product owner, it was clarified that in Colombia, customers must provide both an Identification Type and an Identification Number (VAT) for electronic invoicing, as these details are mandatory for all sales. Additionally, for extra billing addresses, the fields should also be visible and required. To address this, all billing addresses in the Colombian localization must include these fields as required. 1. Install the module "l10n_co_edi_website_sale." 2.
Original PR description
Following a discussion with the product owner, it was clarified that in Colombia, customers must provide both an Identification Type and an Identification Number (VAT) for electronic invoicing, as these details are mandatory for all sales. Additionally, for extra billing addresses, the fields should also be visible and required. To address this, all billing addresses in the Colombian localization must include these fields as required. 1. Install the module "l10n_co_edi_website_sale." 2. Change the default company of the current user to a Colombian company and switch to it. 3. Go to the partner record for the user and change the address to a Colombian address. 4. Add a contact as an invoice address with a Colombian address. 5. Go to the shop, add a product to the cart, and click "Go to checkout." 6. On the address page, click "Save address." The page redirects to itself repeatedly. opw-4309448 Forward-Port-Of: odoo/enterprise#76609
The idea is: 1. Stop to do a lot of thing in the getter `relevantRecords` because all those operations are done every time this getter is called. To achieve that, relevant records are computed each time before the component should be re-rendered and the getter only returns the computed result. It was making the code very hard to work with and very unstable. 2. Move `MrpDisplaySearchModel` `recordCache.ids` into `MrpDisplay` `recordCacheIds`. Why ? Because this array is always used in `MrpD
Original PR description
The idea is: 1. Stop to do a lot of thing in the getter `relevantRecords` because all those operations are done every time this getter is called. To achieve that, relevant records are computed each…
The idea is: 1. Stop to do a lot of thing in the getter `relevantRecords` because all those operations are done every time this getter is called. To achieve that, relevant records are computed each time before the component should be re-rendered and the getter only returns the computed result. It was making the code very hard to work with and very unstable. 2. Move `MrpDisplaySearchModel` `recordCache.ids` into `MrpDisplay` `recordCacheIds`. Why ? Because this array is always used in `MrpDisplay` so it doesn't do a lot of sense to define it in `MrpDisplaySearchModel`. The only exception is in the `_notify` where the cache is invalidated (TODO: to check if it still relevant.) Also, instead of havin an object with one uniq key who refers to an array (`recordCache.ids`), it will now be an array directly. 3. Make `recordCacheIds` part of the `MrpDisplay` `state`. The purpose of this change is to refresh the app everytime the cache is modified. Also, this commit fix an issue where the record cache wasn't correctly updated when the selected employee requieres a PIN code. The issue was the cache was invalided before the PIN code was validated, a lot of async methods weren't awaited and the dialog itself wasn't bound to a callback in a way to be able to invalidate cache at the right moment. OPW-4256568 Forward-Port-Of: odoo/enterprise#74421
Steps to reproduce: 1. Install l10n_mx on runbot and go to MX company 2. Set rates for Day 1 (19.839 MXN/USD) and Day 2 (19.9338 MXN/USD) 3. Create an invoice with date Day 1 for 23,664 USD 4. Add a payment for 9 USD on Day 1 5. Create a bank transaction for a large MXN amount (let's say 600,000) on Day 2 6. Click "Match" for this transaction 7. In reconciliation widget, select invoice created before 8. Change amount in currency reconciled from invoice to 6,954.76 USD (amount in MXN shou
Original PR description
Steps to reproduce: 1. Install l10n_mx on runbot and go to MX company 2. Set rates for Day 1 (19.839 MXN/USD) and Day 2 (19.9338 MXN/USD) 3. Create an invoice with date Day 1 for 23,664 USD 4. Add a…
Steps to reproduce: 1. Install l10n_mx on runbot and go to MX company 2. Set rates for Day 1 (19.839 MXN/USD) and Day 2 (19.9338 MXN/USD) 3. Create an invoice with date Day 1 for 23,664 USD 4. Add a payment for 9 USD on Day 1 5. Create a bank transaction for a large MXN amount (let's say 600,000) on Day 2 6. Click "Match" for this transaction 7. In reconciliation widget, select invoice created before 8. Change amount in currency reconciled from invoice to 6,954.76 USD (amount in MXN should update to 137,975.49) 9. Validate the reconciliation 10. Go to the journal items and show items from journal entry linked to invoice > check partial reconciliation. The reconciled item has a residual of -0.01 and not 0. Analysis: During reconciliation, the rate used is always that of the invoice, not the rate of the invoice residuals. https://github.com/odoo/odoo/blob/4e724323d811dec76c186b5cfff6e4b0135b2128/addons/account/models/account_move_line.py#L1874 However, in the bank reconciliation widget, the residuals' rate was being used to compute the company currency balance of the new AML to create. This led to a different amount than the amount that can actually be reconciled. See [this google sheet](https://docs.google.com/spreadsheets/d/1IoKfuOmSeBS9MrU_DkH_73PGtJd7tb73KuAKm5QsrqI/edit?usp=sharing) for analysis Solution: Use the invoice rate in the bank reconciliation widget. opw-4222310 Forward-Port-Of: odoo/enterprise#76935
The current auto-clean feature doesn't work properly and it deletes spreadsheet that shouldn't be deleted. 1) copy a spreadsheet and leave it (no update) 2) upload an XLSX file Given that it's been broken several times and the usefulness of the feature is debatable, let's just drop the feature. No feature, no bug 🙃 If users create empty spreadsheet, so be it. They'll clean their mess themselves. Task: 4506185 Forward-Port-Of: odoo/enterprise#77573
Original PR description
The current auto-clean feature doesn't work properly and it deletes spreadsheet that shouldn't be deleted. 1) copy a spreadsheet and leave it (no update) 2) upload an XLSX file Given that it's been broken several times and the usefulness of the feature is debatable, let's just drop the feature. No feature, no bug 🙃 If users create empty spreadsheet, so be it. They'll clean their mess themselves. Task: 4506185 Forward-Port-Of: odoo/enterprise#77573
Steps to reproduce: 1) Configure SEPA provider 2) Input wrong IBAN 3) See UI blocked After this commit when a rpc error happens during payment processing UI is unblocked allowing user to see the error. opw-4411773 Forward-Port-Of: odoo/enterprise#77634
Original PR description
Steps to reproduce: 1) Configure SEPA provider 2) Input wrong IBAN 3) See UI blocked After this commit when a rpc error happens during payment processing UI is unblocked allowing user to see the error. opw-4411773 Forward-Port-Of: odoo/enterprise#77634
Partial revert of https://github.com/odoo/enterprise/pull/67111. Some users rely on the structure of the export format (column order). The order is most frequently code, then name. And code is a required field. Those reasons made us want to re-adapt the behavior. We also want the amounts to be formatted with thousands separator and to always have 2 decimals (even if .00) task-4399107 Forward-Port-Of: odoo/enterprise#75740
Original PR description
Partial revert of https://github.com/odoo/enterprise/pull/67111. Some users rely on the structure of the export format (column order). The order is most frequently code, then name. And code is a required field. Those reasons made us want to re-adapt the behavior. We also want the amounts to be formatted with thousands separator and to always have 2 decimals (even if .00) task-4399107 Forward-Port-Of: odoo/enterprise#75740
In error_service, event.preventDefault() is required to prevent uncaught error message due to latest Chrome version (132) compatibility. 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#194789
Original PR description
In error_service, event.preventDefault() is required to prevent uncaught error message due to latest Chrome version (132) compatibility. 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#194789
This commit makes the same fix as [1] but it does t for kanban views instead of list views. We discovered in task [2] we were developing for the master branch that we needed this fix and that we wanted to fix it from 17.0 [1]: ecc0a38a1d3b04f854d761fd498b120a4dfef5ad [2]: opw-4370092 Task: opw-4370092 Forward-Port-Of: odoo/odoo#194859
Original PR description
This commit makes the same fix as [1] but it does t for kanban views instead of list views. We discovered in task [2] we were developing for the master branch that we needed this fix and that we wanted to fix it from 17.0 [1]: ecc0a38a1d3b04f854d761fd498b120a4dfef5ad [2]: opw-4370092 Task: opw-4370092 Forward-Port-Of: odoo/odoo#194859
Because 'Tax ID' was within the `t-esc` the term was never translated. This goes against some country's compliance requirements for receipts, so we make it translatable now. 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#194801
Original PR description
Because 'Tax ID' was within the `t-esc` the term was never translated. This goes against some country's compliance requirements for receipts, so we make it translatable now. 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#194801
Before this commit, it could happen that the autocomplete does not find the option to select. Now, we give the option to select so we're sure that the option exists when we select it. runbot errors: 5759, 102534, 111418 Forward-Port-Of: odoo/odoo#194672 Forward-Port-Of: odoo/odoo#124584
Original PR description
Before this commit, it could happen that the autocomplete does not find the option to select. Now, we give the option to select so we're sure that the option exists when we select it. runbot errors: 5759, 102534, 111418 Forward-Port-Of: odoo/odoo#194672 Forward-Port-Of: odoo/odoo#124584
Before this commit, the domain containing the limited category information was not used correctly, causing products from other categories to be loaded. opw-4451297 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#192653
Original PR description
Before this commit, the domain containing the limited category information was not used correctly, causing products from other categories to be loaded. opw-4451297 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#192653
Before: The typofix feature treats terms in the old and new values with similar text content as the same term, migrating the translations of the old term to the new term. For example The old value has the mapping: 'Draft': 'Brouillon' The new value contains the term: '<span invisible="name or name_placeholder or quick_edit_mode">Draft</span>' Since the old term and the new term share the same text content, 'Draft', after `write`, the new term reuses the old translation of 'Draft'.
Original PR description
Before: The typofix feature treats terms in the old and new values with similar text content as the same term, migrating the translations of the old term to the new term. For example The old value…
Before:
The typofix feature treats terms in the old and new values with similar text content as the same term, migrating the translations of the old term to the new term.
For example
The old value has the mapping:
'Draft': 'Brouillon'
The new value contains the term:
'<span invisible="name or name_placeholder or quick_edit_mode">Draft</span>'
Since the old term and the new term share the same text content, 'Draft', after `write`, the new term reuses the old translation of 'Draft'. However, the translation 'Brouillon' is always visible, unlike its en_US counterpart.
This behavior is acceptable in non-upgrade mode because the user writes the en_US value and is responsible for verifying translations afterward. However, it is problematic during upgrades because users cannot easily identify which records have changed and need to be rechecked.
After:
The translation inheritance behavior can be described as below Translations can be inherited after `write` from old terms to new terms which share the very close text contents
1. when `write` in production mode, text contents for translation terms are more important than the HTML/XML structures of them, and the old term translations should be remained as much as possible. Because
* the writing user is responsible to recheck all translations after `write`.
* it is easier for the writing user to copy technical HTML/XML structures than translate text contents for a language they may not know.
* the feature can also be used as typofix when the only small diff is the text content
2. when `write` in upgrade time, the HTML/XML structure is more important than the text content, and the new term structure should be remained as much as possible. Because
* HTML/XML structures might be changed a lot after upgrade, which may contain behavior relevant diff (e.g. `invisible`), even if text contents are not changed.
* users have no idea which records' values are changed during upgrade and are hard to recheck their translations.
* new terms are highly likely to be correctly translated in the latest po files which will be imported during upgrade.
* the typofix feature can still be remained when the only small diff is the text content
Based on the above feature analysis, we use the below new strategy
1. translations can be inherited only if the old source term and the new source term share the same HTML/XML structure
2. translations can be inherited only if the old translation term and the new source term share the same HTML/XML structure
3. when translations are inherited, MODIFIER_ATTRS will be synchronized with the new source term, other attributes will be copied from the source term if available.
Forward-Port-Of: #194181
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-prDescription of the issue/feature this PR addresses: Task ID: 4342267 Current behavior before PR: -Error When printing draft invoice due to unset invoice_date. -Report spacing between header & body in second page overlaps due to paperformat spacing. Due to the long address format of saudi arabia, the default paperformat header spacing and margin top are not enough to show the full address without overlapping the second and onward pages. -English labels on the exchange rate table in l1
Original PR description
Description of the issue/feature this PR addresses: Task ID: 4342267 Current behavior before PR: -Error When printing draft invoice due to unset invoice_date. -Report spacing between header & body in…
Description of the issue/feature this PR addresses: Task ID: 4342267 Current behavior before PR: -Error When printing draft invoice due to unset invoice_date. -Report spacing between header & body in second page overlaps due to paperformat spacing. Due to the long address format of saudi arabia, the default paperformat header spacing and margin top are not enough to show the full address without overlapping the second and onward pages. -English labels on the exchange rate table in l10n_sa_edi are translated and not shown together with the arabic labels. -Remove unnecessary spans in xpaths Desired behavior after PR is merged: -Fix printing draft invoice with invoice_date as today's date -Fix report spacing header by adding a new A4 paperformat for l10n_sa which is set as the saudi arabia companies default paper format. -Fix exchange rate table to show both arabic and english labels and remove unnecessary translations (no longer used) -Remove unnecessary spans in xpath. --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#193364 Forward-Port-Of: odoo/odoo#190172
Currently the different documents are responsible on the move's cancelation. E.g. cancel a SO will delete all the pickings with the same procurement group. Cancel a PO will cancel the receipt an all the moves destination. But in inter company transaction or inter warehouse. The source document is a stock.move directly (or a rr but it's already unlink) Some users delete the receipt from another warehouse but the delivery on the other still exists. So it let pickings that are never cancel in ot
Original PR description
Currently the different documents are responsible on the move's cancelation. E.g. cancel a SO will delete all the pickings with the same procurement group. Cancel a PO will cancel the receipt an all the moves destination. But in inter company transaction or inter warehouse. The source document is a stock.move directly (or a rr but it's already unlink) Some users delete the receipt from another warehouse but the delivery on the other still exists. So it let pickings that are never cancel in other companies/warehouses. This commit and an option to allow the cancel propagate upstream. It's hidden under the `stock.cancel_moves_origin` system parameter in order to avoid a huge behavior modification for other users. opw-3274939 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#186730
### Steps to reproduce: - Install "l10n_ch" and switch to a Swiss company - Create an invoice for a Swiss partner - Send it - The QR code appears in the generated PDF ### Cause: The bank eligibility is not checked when printing the QR code. ### Solution: After a discussion with the PO (THB) the Qr codes should appear on all Swiss transaction. But if the fiscal country of the user's company is not Switzerland, it must still be printed if its bank account is eligible to receive payment
Original PR description
### Steps to reproduce: - Install "l10n_ch" and switch to a Swiss company - Create an invoice for a Swiss partner - Send it - The QR code appears in the generated PDF ### Cause: The bank eligibility is not checked when printing the QR code. ### Solution: After a discussion with the PO (THB) the Qr codes should appear on all Swiss transaction. But if the fiscal country of the user's company is not Switzerland, it must still be printed if its bank account is eligible to receive payments via QRcodes. So the solution is to add a check if the fiscal_country is not Switzerland, then we check the account validity. A valid account is an IBAN account of this type CHXX 3000 0XXX XXXX with the number in the middle being between 30000 and 31999. opw-4380520 Forward-Port-Of: odoo/odoo#194563 Forward-Port-Of: odoo/odoo#194421
### Issue: - The negative values in Vendor Bills are not being reflected in the Analytic Account linked to a project. - the negative value does not reduce the project’s total cost in the Analytic Report cost calculations. ### Steps to reproduce: 1- Create a project and set an analytic account or use the "Renovations" project. 2- Create a vendor bill. 3- On the VB add two lines one with a positive Price and the other with a negative Price. 4- on `Analytic` of each line set the projec
Original PR description
### Issue: - The negative values in Vendor Bills are not being reflected in the Analytic Account linked to a project. - the negative value does not reduce the project’s total cost in the Analytic…
### Issue:
- The negative values in Vendor Bills are not being reflected in the Analytic Account linked to a project.
- the negative value does not reduce the project’s total cost in the Analytic Report cost calculations.
### Steps to reproduce:
1- Create a project and set an analytic account or use the "Renovations" project.
2- Create a vendor bill.
3- On the VB add two lines one with a positive Price and the other with a negative Price.
4- on `Analytic` of each line set the project to `Renovations` or the project you created.
5- Validate the vendor bill.
6- Go to the project app and click on the 3 dots of the project you choose and click on `Project Updates`.
7- Notice the total cost of the project is not reflecting the negative value of the vendor bill.
### Solution:
- The issue is caused by the condition ('price_subtotal', '>', 0) in the query for account.move.line.
- Removing this condition ensures both positive and negative price_subtotal values are included.
opw-[4416931](https://www.odoo.com/web#id=4416931&view_type=form&model=project.task)
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#194837
Forward-Port-Of: odoo/odoo#194300When creating a new mass mailing from an event, the default domain retrieved when switching mailing type is missing the event id filter Steps to reproduce (mass_mailing_sms required): - Open an event with attendees - Click 'Contact Attendees' - Take note of the mailing domain - Switch Mailing Type from Email to SMS Issue: Domain is missing the event_id This does not occur when opening the form view because the default mailing domain is given via context opw-4337256 Forward-Port-
Original PR description
When creating a new mass mailing from an event, the default domain retrieved when switching mailing type is missing the event id filter Steps to reproduce (mass_mailing_sms required): - Open an event with attendees - Click 'Contact Attendees' - Take note of the mailing domain - Switch Mailing Type from Email to SMS Issue: Domain is missing the event_id This does not occur when opening the form view because the default mailing domain is given via context opw-4337256 Forward-Port-Of: odoo/odoo#190684 Forward-Port-Of: odoo/odoo#189317
Before this commit, if a gift card was created in another company and the gift card program was not assigned to any company, using the gift card in another company resulted in an error. opw-4422730 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#192246
Original PR description
Before this commit, if a gift card was created in another company and the gift card program was not assigned to any company, using the gift card in another company resulted in an error. opw-4422730 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#192246
Check commits for description. OPW: 4348541 Forward-Port-Of: odoo/odoo#194406 Forward-Port-Of: odoo/odoo#194203
Original PR description
Check commits for description. OPW: 4348541 Forward-Port-Of: odoo/odoo#194406 Forward-Port-Of: odoo/odoo#194203
Fixes an issue with the xml file where the tax exchange rate node would be added before the payment terms node if both features are used, which render the xml wrong. Also add a sudo when getting the system param for the test url; as this shouldn't block a non administrator user from testing the feature. opw-4425472 opw-4505562 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194971
Original PR description
Fixes an issue with the xml file where the tax exchange rate node would be added before the payment terms node if both features are used, which render the xml wrong. Also add a sudo when getting the system param for the test url; as this shouldn't block a non administrator user from testing the feature. opw-4425472 opw-4505562 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194971
Problem: When printing an invoice with l10n_cl installed, the tax total will display the lavel as 'VAT.' The user expects 'VAT' to be translated to maybe 'IVA.' It is hardcoded into the view, thus the .pot file needs to be updated. Note: Starting from v17, there are missing translations for strings "Net Amount", "Total", "Exempt Amount" in the .pot file for the view l10n_cl.tax_totals_widget. However, these are present for v16. Will probably need to modify the fw-ports to include these st
Original PR description
Problem: When printing an invoice with l10n_cl installed, the tax total will display the lavel as 'VAT.' The user expects 'VAT' to be translated to maybe 'IVA.' It is hardcoded into the view, thus…
Problem: When printing an invoice with l10n_cl installed, the tax total will display the lavel as 'VAT.' The user expects 'VAT' to be translated to maybe 'IVA.' It is hardcoded into the view, thus the .pot file needs to be updated. Note: Starting from v17, there are missing translations for strings "Net Amount", "Total", "Exempt Amount" in the .pot file for the view l10n_cl.tax_totals_widget. However, these are present for v16. Will probably need to modify the fw-ports to include these strings in the file. Purpose: Updating the .pot file to include the hardcoded VAT string will ensure there are translations for that label. Steps to Reproduce on Runbot: 1. Install l10n_cl and Accounting 2. Add Spanish as a language 3. Switch to the CL company 4. Create an invoice for a customer whose language is Spanish 5. Print the invoice and notice 'VAT' is not translated opw-4383092 --- I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr Forward-Port-Of: odoo/odoo#194800 Forward-Port-Of: odoo/odoo#190605
Steps ----- - Have a user with 'Employees' Administator rights and no 'Administration' rights. - Create a new employee. - When viewing the Kanban views of employees, the image for the newly created employee appears corrupted (the text 'binary file' appears instead of the image). Cause ----- When we create a new employee, `_avatar_generate_svg` is called https://github.com/odoo/odoo/blob/717f3a1ab25613c02c2d0b28fa8dd73f4e6c75e0/addons/hr/models/hr_employee.py#L497-L498 that returns a svg
Original PR description
Steps ----- - Have a user with 'Employees' Administator rights and no 'Administration' rights. - Create a new employee. - When viewing the Kanban views of employees, the image for the newly created employee appears corrupted (the text 'binary file' appears instead of the image). Cause ----- When we create a new employee, `_avatar_generate_svg` is called https://github.com/odoo/odoo/blob/717f3a1ab25613c02c2d0b28fa8dd73f4e6c75e0/addons/hr/models/hr_employee.py#L497-L498 that returns a svg/xml base-64 encoded. However, only users with write rights to `ir.ui.view` are able to create svg/xml attachments. https://github.com/odoo/odoo/blob/717f3a1ab25613c02c2d0b28fa8dd73f4e6c75e0/odoo/addons/base/models/ir_attachment.py#L368-L371 Else, the attachment has a text mimetype forced, leading to it being incorrectly displayed. Change ----- A default image is not generated at employee creation if the user doesn't have sufficient rights. opw-4311251 Forward-Port-Of: odoo/odoo#190214