Thursday, August 15, 2024
4 changes · saas-17.4
Resolved issues and error corrections
Creating a new partner now immediately shows the country-specific Indian fields when the company is based in India. This prevents confusion and avoids users having to save the partner first before seeing required local information.
Original PR description
Steps to reproduce: - Clean DB with only one Indian company - Create a new partner - The Indian fields are not shown --> NOT OK - Save the record - The Indian fields are now shown --> OK Explanation: This is because the compute method `_compute_fiscal_country_codes` is not called when creating a new record. It is only called when the record is saved. Solution: Set a default value to the field `fiscal_country_codes` task-id: none
Miscellaneous changes
**Steps to reproduce:** (Require credentials) - Install l10n_eg_edi_eta - Switch to an Egyptian company - Configure the Egyption localization - Create an invoice and post it to ETA - Go to ETA portal and reject the invoice - From invoice in Odoo, request EDI cancellation **Issue:** The following error is displayed: { 'code': 'ValidationError', 'message': None, 'target': 'Update Document Status', 'details': [{ 'code': None, 'target': 'Document.UUID
Original PR description
**Steps to reproduce:** (Require credentials)
- Install l10n_eg_edi_eta
- Switch to an Egyptian company
- Configure the Egyption localization
- Create an invoice and post it to ETA
- Go to ETA portal and reject the invoice
- From invoice in Odoo, request EDI cancellation
**Issue:**
The following error is displayed:
{
'code': 'ValidationError',
'message': None,
'target': 'Update Document Status',
'details': [{
'code': None,
'target': 'Document.UUID',
'message': 'Provided Status is invalid, based on the current document status.'
}]
}
**Solution:**
Before cancelling an invoice, check submission status.
If it's cancelled or rejected, do not send the cancellation EDI request and responds to the method with a success.
opw-3884519
---
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
Forward-Port-Of: odoo/odoo#170406Steps: - install 'purchase' and 'analytic' - open purchase/RFQ - create a new rfq - add a new line in the subview list - Toggle `Analytic Distribution` optional column - Edit 'Analytic Distribution' col with the widget (`analytic_disribution`) - Select first column to edit it (`Projects (100%)`) - Click on `Search More` in the dropdown - A new dialog is opened `Search: Projects` - Go to filters and click `Add Custom Filter` - Another modal is now opened `Add Custom Filter` - Click on
Original PR description
Steps: - install 'purchase' and 'analytic' - open purchase/RFQ - create a new rfq - add a new line in the subview list - Toggle `Analytic Distribution` optional column - Edit 'Analytic Distribution'…
Steps:
- install 'purchase' and 'analytic'
- open purchase/RFQ
- create a new rfq
- add a new line in the subview list
- Toggle `Analytic Distribution` optional column
- Edit 'Analytic Distribution' col with the widget (`analytic_disribution`)
- Select first column to edit it (`Projects (100%)`)
- Click on `Search More` in the dropdown
- A new dialog is opened `Search: Projects`
- Go to filters and click `Add Custom Filter`
- Another modal is now opened `Add Custom Filter`
- Click on the first domain input
- After clicking on this input, the initial `analytic_distribution` drodown is closed
- This is the cause of the problem
- Validate your domain
- Traceback `Component is destroyed`
The initial problem comes from `AnalyticDistribution` Component.
There's a listener on `click`on `document` to manage whether or not to close the widget.
There are several cases that prevent the widget from closing:
- having an active modal containing a list view or kanban view with the following selectors:
- `'.o_modal:not(.o_inactive_modal) .o_list_view'`
- `'.o_modal:not(.o_inactive_modal) .o_kanban_view'`.
- if the click occurred in the widget element
- if the dropdown is closed
However in many other cases we have undesired behavior (unwanted closing of the widget):
- a click on dialog that is open and not modal (as in the steps above)
- a click on a popover
- drag and drop an active modal to the side
This fix normally corrects the first three cases, but unfortunately I haven't found a way to correct the case of the palette command where the `ev.target` is at the point where the element selected in the palette points into the dom, especially as this is not currently the customer's problem.
Here's how the other cases are fixed:
instead of having a condition for each case
(as there used to be for modal list view and modal kanban view)
```js
const modal = document.querySelector('.modal:not(.o_inactive_modal)');
const clickedInSearchMoreDialog = modal && modal.querySelector('.o_list_view') && modal.contains(ev.target);
const clickedInKanbanSelectorDialog = modal && modal.querySelector('.o_kanban_view') && modal.contains(ev.target);
```
I create a list of css selectors corresponding to the elements in which the `ev.target` must not be located in order to close. In particular, I include the two cases already handled by the code, as well as the new ones.
Instead of having the two previous conditions, I just have one selector in my list.
https://github.com/odoo/odoo/blob/4637514b4b1550014fc6affff1b0753ab9bc0f69/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.js#L611
So I add the `o_popover` and `o_dialog` selectors to correct my initial problem.
When dragging and dropping a modal, the `ev.target` is always equal to the document, so to prevent the `analytic_distribution` widget from closing in this case I check that it's not equal to `documentElement`.
https://github.com/odoo/odoo/blob/4637514b4b1550014fc6affff1b0753ab9bc0f69/addons/analytic/static/src/components/analytic_distribution/analytic_distribution.js#L617
opw-3954404
Forward-Port-Of: odoo/odoo#168920Steps to reproduce: 1. Install `l10n_in_withholding` and `l10n_it_edi_withholding` 2. Create a new company with country `India` and load CoA TDS taxes doesn't get created After this commit: We resolve the above issue. Since the issue was caused by a typo in the method name in `l10n_in_withholding` which had a definition in `l10n_it_edi_withholding` Description of the issue/feature this PR addresses: Current behavior before PR: Desired behavior after PR is merged: ---
Original PR description
Steps to reproduce: 1. Install `l10n_in_withholding` and `l10n_it_edi_withholding` 2. Create a new company with country `India` and load CoA TDS taxes doesn't get created After this commit: We resolve the above issue. Since the issue was caused by a typo in the method name in `l10n_in_withholding` which had a definition in `l10n_it_edi_withholding` 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#176565