Tuesday, January 31, 2023
29 changes · master
New functionality added to Odoo
Adds Ecuador-specific electronic document exchange with the national tax authority, including invoice XML generation, digital signing, submission, and status tracking. It also adds local tax withholding workflows, legally required invoice report formats, and company settings needed for Ecuadorian compliance.
Original PR description
# Ecuadorian localisation: EDI (Servicio de Rentas Internas) Developped in collaboration with 3Cloud's @pepetreshere @JuanDanielAlvarez @stevTresCloud ## Modified models - Partners now have a…
# Ecuadorian localisation: EDI (Servicio de Rentas Internas) Developped in collaboration with 3Cloud's @pepetreshere @JuanDanielAlvarez @stevTresCloud ## Modified models - Partners now have a **Taxpayer Type**, mapping them to certain Withhold taxes - Products now have a **Profit Withhold** tax - Journals can now be configured as **Purchase Liquidation** - Countries now have an **ATS code** and **Tax Haven Code** ## Electronic Data Interchange - Automatic generation of XMLs for relevant documents - Management of user's digital certificates - Digital signature of XMLs with XAdES - Sending of documents to government and retrieving status information from them: sales invoices, credit and debit notes, purchase liquidations, purchase withholds ## Invoicing - Customization of PDF reports according to legal requirements, including barcode - Support for multi-currency ## Withholds - Wizard for withhold creation, automatic computation of base amount - Withholds are created as `account.move` of type `entry`, related to their invoice of origin - Two types, purchase (`in_withhold` related to `in_invoice`) and sale (`out_withhold` related to `out_invoice`) - Purchase withholds: automatic suggestion of withhold lines (taxes and amounts) based on payment method, products and services ## Company settings - **Test** and **production** environments, test environment usable without digital certificates - Ecuadorian localization settings: legal name, agent number, forced to keep accounting, certificate selection - Tax defaults for products, services, credit/debit/gift card payments
Enhancements to existing features
GST report configuration is now grouped within the Indian Integration settings instead of appearing as a separate settings block. This makes the setup page more organized and easier for users managing Indian compliance settings to navigate.
Original PR description
Before this commit ================== GST Report configuration was having a separate setting block. After this commit ================= GST integration settings will be shown in the setting block of the Indian Integration.
Resolved issues and error corrections
This change prevents incorrect period calculations when the Trimester monthly report option is used for Spanish BOE 349 tax reports. It helps ensure refund records are generated with the right reporting period and year, reducing the risk of reporting errors.
Original PR description
If the "Trimester monthly report" option is enabled when generating a BOE 349 tax report, it reduces `date_to` in the `options` dict by 1 month. If later we try to calculate the period and year from those modified values, that will fail in the trimester case because `_get_mod_period_and_year` is expecting 3 months instead of 2. To avoid this, we pass the period and year into `_write_type2_refund_records` as arguments so the values don't have to be recalculated again. This wasn't done in the original bug fix in https://github.com/odoo/enterprise/pull/36228 to avoid changing the function signature. opw-3131030
Miscellaneous changes
Before this commit, Recurring pills could be erroneously hidden after confirming. Forward-Port-Of: odoo/enterprise#36522
Original PR description
Before this commit, Recurring pills could be erroneously hidden after confirming. Forward-Port-Of: odoo/enterprise#36522
Norwegian translations were added for key accounting reports, including balance sheets and profit and loss statements. This makes financial reporting clearer and more usable for Norwegian-speaking users.
Original PR description
Before this PR, the balance sheet and profit and loss were written in english but the translation was missing, this PR correct that Task-id: 3149392
The Luxembourg tax reporting test was updated to reflect the current 2023 tax rates used by the OSS module. This helps keep automated checks aligned with the latest tax setup and prevents false test failures.
Original PR description
In https://github.com/odoo/odoo/commit/e7edd71a3a4d8d7297c07f44b6b701052f2c5b7d the LU taxes in the OSS module where updated in the odoo repo in 14.0, but in 15.0 a test was added in the enterprise repo, still using the old taxes. This change updates the test to use the new taxes for 2023. task-3159138 Related: https://github.com/odoo/odoo/pull/111286
Luxembourg added new fields and modified some rules for VAT reports. Monthly and Annual Simplified reports have been already updated. The first commit updates the full Annual VAT report. - Adds new fields - Adjusts formulas The second commit adds the possibility of exporting the Annual VAT report as a pdf file for a better overview of the form. task-3103724 Forward-Port-Of: odoo/enterprise#36472 Forward-Port-Of: odoo/enterprise#35051
Original PR description
Luxembourg added new fields and modified some rules for VAT reports. Monthly and Annual Simplified reports have been already updated. The first commit updates the full Annual VAT report. - Adds new fields - Adjusts formulas The second commit adds the possibility of exporting the Annual VAT report as a pdf file for a better overview of the form. task-3103724 Forward-Port-Of: odoo/enterprise#36472 Forward-Port-Of: odoo/enterprise#35051
We want to reuse the purchase.order matching logic to enhance vendor bill created for the OCR in documents (EDI, PDF,..). This code has been move to the purchase module. task-id: 2828521 Forward-Port-Of: odoo/enterprise#36461
Original PR description
We want to reuse the purchase.order matching logic to enhance vendor bill created for the OCR in documents (EDI, PDF,..). This code has been move to the purchase module. task-id: 2828521 Forward-Port-Of: odoo/enterprise#36461
Avatax stopped providing free trials. Instead users should now use a shared partner sandbox account. The sandbox account will have a single company and in that company the document codes for the invoices (field `avatax_unique_code`, e.g. Journal Entry 1) must be unique. If an invoice with the same document code is submitted Avatax will return an "Invalid DocStatus" error. The `avatax_unique_code` is created using the database ID, so across different Odoo instances there will be collisions. In
Original PR description
Avatax stopped providing free trials. Instead users should now use a shared partner sandbox account. The sandbox account will have a single company and in that company the document codes for the…
Avatax stopped providing free trials. Instead users should now use a shared partner sandbox account. The sandbox account will have a single company and in that company the document codes for the invoices (field `avatax_unique_code`, e.g. Journal Entry 1) must be unique. If an invoice with the same document code is submitted Avatax will return an "Invalid DocStatus" error. The `avatax_unique_code` is created using the database ID, so across different Odoo instances there will be collisions. In order to work around this Avatax recommend we switch to the "createoradjust" endpoint [1]. It's a drop-in replacement for "create" that will updated even committed invoices. It only errors when an invoice is reported to a tax authority, but that will never happen in a sandbox environment. This commit uses that endpoint in sandbox mode. For production nothing changes. [1] https://developer.avalara.com/api-reference/avatax/rest/v2/methods/Transactions/CreateOrAdjustTransaction opw-3152188 PR note: only targeting v16 since that's where this is most needed (for sales demos etc.). I want to avoid needlessly changing the previous versions. Forward-Port-Of: odoo/enterprise#36504
Often we have one account for connecting to a web service (e.g. sending invoices to the gov) and as it can be different per company. The credentials fields are stored on the company but there is no security groups=`'base.group_system'` , so these are visible by every user, because `res_company` fields can be seen by everyone. This commits adds `groups='base.group_system'` on credentials fields. This also requires a `sudo()` whenever we call these fields. task-3044048 Forward-Port-Of: odoo/e
Original PR description
Often we have one account for connecting to a web service (e.g. sending invoices to the gov) and as it can be different per company. The credentials fields are stored on the company but there is no security groups=`'base.group_system'` , so these are visible by every user, because `res_company` fields can be seen by everyone. This commits adds `groups='base.group_system'` on credentials fields. This also requires a `sudo()` whenever we call these fields. task-3044048 Forward-Port-Of: odoo/enterprise#36487 Forward-Port-Of: odoo/enterprise#36385
Module was written in French while we want the code to be in English. Also some translations were on Transifex on 15.0 and got lost in the transition to 16.0 since we have no Transifex project for them anymore. This PR translates the module to English and reintroduce lost translations for French and Dutch. We also remove i18n_extra that is both incorrect (wrong module name) and outdated. Task: 3127437 Forward-Port-Of: odoo/enterprise#35268
Original PR description
Module was written in French while we want the code to be in English. Also some translations were on Transifex on 15.0 and got lost in the transition to 16.0 since we have no Transifex project for them anymore. This PR translates the module to English and reintroduce lost translations for French and Dutch. We also remove i18n_extra that is both incorrect (wrong module name) and outdated. Task: 3127437 Forward-Port-Of: odoo/enterprise#35268
latam 729 ---- unit tests for https://github.com/odoo/odoo/pull/84350 This new unit tests add vendor bill and vendor refund of doc type 186 (liquido producto) and ensure that the purchase vat book is correctly generated. Forward-Port-Of: odoo/enterprise#33188 Forward-Port-Of: odoo/enterprise#24561
Original PR description
latam 729 ---- unit tests for https://github.com/odoo/odoo/pull/84350 This new unit tests add vendor bill and vendor refund of doc type 186 (liquido producto) and ensure that the purchase vat book is correctly generated. Forward-Port-Of: odoo/enterprise#33188 Forward-Port-Of: odoo/enterprise#24561
This commit sets `field_values` to an empty dict in case it's `None` and checks if fields exist in the dictionary before retrieving the values. Without this, rendering the template may result in an error. Forward-Port-Of: odoo/enterprise#36485 Forward-Port-Of: odoo/enterprise#36465
Original PR description
This commit sets `field_values` to an empty dict in case it's `None` and checks if fields exist in the dictionary before retrieving the values. Without this, rendering the template may result in an error. Forward-Port-Of: odoo/enterprise#36485 Forward-Port-Of: odoo/enterprise#36465
Issue: - When any company creates the UoM record it stores the current company country code in `l10n_co_edi_country_code`. - Ex. A 'US' company creates the UoM record so the value stored in 'l10n_co_edi_country_code' is 'US', then we switch the company to 'CO' company, then still that record 'l10n_co_edi_country_code' value is 'US' because of that the `l10n_co_edi_ubl` field attrs not working correctly. So In this commit, we have removed attrs from the `Colombia Código UBL` fiel
Original PR description
Issue: - When any company creates the UoM record it stores the current company country code in `l10n_co_edi_country_code`. - Ex. A 'US' company creates the UoM record so the value stored in 'l10n_co_edi_country_code' is 'US', then we switch the company to 'CO' company, then still that record 'l10n_co_edi_country_code' value is 'US' because of that the `l10n_co_edi_ubl` field attrs not working correctly. So In this commit, we have removed attrs from the `Colombia Código UBL` field so it's displayed in every company. TaskID - 2784512 Forward-Port-Of: odoo/enterprise#36454 Forward-Port-Of: odoo/enterprise#27435
Before this commit, when relinking a social account, a traceback was raised because an RPC call is made on the wrong model (`social_media` instead of `social.media`). opw-3119581 Forward-Port-Of: odoo/enterprise#36438
Original PR description
Before this commit, when relinking a social account, a traceback was raised because an RPC call is made on the wrong model (`social_media` instead of `social.media`). opw-3119581 Forward-Port-Of: odoo/enterprise#36438
…company not set in chart before this commit, on creating a consolidation journal with consolidation chart in which no companies are set, is raising the access right error. * Consolidation -> Configuration - > Consolidation * create a consolidation and leave companies field empty * now click on periods smart button and enter the necessary details and save * click Edit smart button from period's form * click add a column from the screen and enter name and click save after this comm
Original PR description
…company not set in chart before this commit, on creating a consolidation journal with consolidation chart in which no companies are set, is raising the access right error. * Consolidation -> Configuration - > Consolidation * create a consolidation and leave companies field empty * now click on periods smart button and enter the necessary details and save * click Edit smart button from period's form * click add a column from the screen and enter name and click save after this commit, no access right error will be raised and allow to create consolidated journals. https://user-images.githubusercontent.com/27989791/214810251-27e2db33-9d5c-43bf-848b-70c2a48d5465.mp4 Forward-Port-Of: odoo/enterprise#36307
This revision is related to odoo/enterprise#34752 When a `<t>` node with a `groups` attribute is set in a view, this `<t>` block must remain, whatever the case, so the view sent to the web client with Studio represents the actual view in the backend. This is so the xpath computed by Studio is based on the same blocks in the actual view in the database then what is sent by `get_views`. It was already the case when the user did not have the group, but it wasn't the case when the user had t
Original PR description
This revision is related to odoo/enterprise#34752 When a `<t>` node with a `groups` attribute is set in a view, this `<t>` block must remain, whatever the case, so the view sent to the web client…
This revision is related to odoo/enterprise#34752 When a `<t>` node with a `groups` attribute is set in a view, this `<t>` block must remain, whatever the case, so the view sent to the web client with Studio represents the actual view in the backend. This is so the xpath computed by Studio is based on the same blocks in the actual view in the database then what is sent by `get_views`. It was already the case when the user did not have the group, but it wasn't the case when the user had the group. In such a case the call to super was done with the `groups` attribute left, and the call to super therefore removed the `<t>` block itself (moving its content out of it first). This revision solves the below use case: Steps to reproduce: - Install Sales, CRM and studio - Go to Sales > Orders > Sales Teams - Now activate studio, and try to modify the progressbar widget. Issue: We are going to receive an error message and we will be unable to change ths widget. opw-3106068 closes odoo/odoo#111111 Forward-Port-Of: odoo/enterprise#36460
…sifex Some translations were lost when we changed to 16.0 since there is no l10n_* project for 16.0 on Transifex. Reintroduced lost translations for Arabic, German, French, Italian, Dutch and Chinese. Task: 3083996 Forward-Port-Of: odoo/enterprise#35270
Original PR description
…sifex Some translations were lost when we changed to 16.0 since there is no l10n_* project for 16.0 on Transifex. Reintroduced lost translations for Arabic, German, French, Italian, Dutch and Chinese. Task: 3083996 Forward-Port-Of: odoo/enterprise#35270
Steps to reproduce: - Activate the discount in the Sales settings; - Create a SO with a product that can be rented; - Add a discount and confirm the order; - Validate the pickup. Current behaviour: The discount disappears on the SO line. Expected behaviour: The discount remains on the SO line. This commit prevents updating the `product_uom_qty` of the line if the delivered quantity does not become larger than set on the SO line. The reason is that a change in the `product_uom_qty`
Original PR description
Steps to reproduce: - Activate the discount in the Sales settings; - Create a SO with a product that can be rented; - Add a discount and confirm the order; - Validate the pickup. Current behaviour: The discount disappears on the SO line. Expected behaviour: The discount remains on the SO line. This commit prevents updating the `product_uom_qty` of the line if the delivered quantity does not become larger than set on the SO line. The reason is that a change in the `product_uom_qty` triggers a compute of the SOL price that does not take the discount into account. OPW-3146922 Forward-Port-Of: odoo/enterprise#36421 Forward-Port-Of: odoo/enterprise#36410
When generating a BOE 349 Spanish tax report with the "Trimester monthly report" option enabled, and if there are refunds included in the report period, you will get an empty traceback. The reason this happens is that when that report option is enabled, it will reduce the `date_to` of the report filter by 1 month (because that's what that feature does). A `_get_mod_period_and_year` call later on uses `date_from` and `date_to` to determine the year and period and the period calculation will fail
Original PR description
When generating a BOE 349 Spanish tax report with the "Trimester monthly report" option enabled, and if there are refunds included in the report period, you will get an empty traceback. The reason…
When generating a BOE 349 Spanish tax report with the "Trimester monthly report" option enabled, and if there are refunds included in the report period, you will get an empty traceback. The reason this happens is that when that report option is enabled, it will reduce the `date_to` of the report filter by 1 month (because that's what that feature does). A `_get_mod_period_and_year` call later on uses `date_from` and `date_to` to determine the year and period and the period calculation will fail and return None because it's not aware of the modification. Later on when the period is used and subscripted it will give the traceback. The solution used here uses the `options` dict to keep the original `date_to` for `_get_mod_period_and_year` to use. A cleaner solution could be to simply pass `year` and `period` to `_mod_349_write_type2_refund_records` in `_boe_export_mod349` so the `_get_mod_period_and_year` call isn't needed anymore. But this requires modifying the function signature for `_mod_349_write_type2_refund_records`. The traceback being empty is a separate issue, I've seen many different kinds of errors occur and they all end up showing as blank. To be fixed in a different PR. Steps to reproduce 1. Start from a clean 14.0 database 2. Set the default company to have Spain as the country 3. Install Accounting and Contacts 4. In Contacts, create a new company contact called Odoo and its country to Belgium. What matters is that the country is European but not Spain. Set the VAT number to BE0477472701. 5. Switch to the default ES Company that got added after installing Accounting 6. In Accounting, create a customer invoice for the Odoo contact with some random product that has a price. Set the invoice date to somewhere in Q4 2022 (like 15 November 2022). In the AEAT data tab, set the type for mod 349 to "A - Acquisition". 7. Revert the customer invoice as a full refund and with the same date as the invoice. 8. In Accounting, go to Reporting -> Tax Report (Mod 349), and set the date filter to the last trimester (currently Q4 2022). You should see an amount on the line "A. Adquisiciones intracomunitarias sujetas" under "Reembolsos". 9. Press the "Export (BOE)" button, and check "Trimester monthly report". Click "Generate BOE". 10. Empty traceback opw-3131030 Forward-Port-Of: odoo/enterprise#36419 Forward-Port-Of: odoo/enterprise#36228
Same issue as in d0e3d2496bc1f99ae110f6abc46c176d874df223 Owl 2.0.3 properly escapes backslashes when generating block strings [1]. As a consequence, the non breakable spaces used in the legacy grid views now get escaped and are displayed as text. This commit ensures they're correctly evaluated as html. [1] odoo/owl@530c2f9 Forward-Port-Of: odoo/enterprise#36426
Original PR description
Same issue as in d0e3d2496bc1f99ae110f6abc46c176d874df223
Owl 2.0.3 properly escapes backslashes when generating block
strings [1]. As a consequence, the non breakable spaces used in
the legacy grid views now get escaped and are displayed as text.
This commit ensures they're correctly evaluated as html.
[1] odoo/owl@530c2f9
Forward-Port-Of: odoo/enterprise#36426…0/Transifex Some translations were lost when we changed version to 16.0 since there is no l10n_* project for 16.0 on Transifex. Reintroduced lost translations for German, Dutch and French. Task: 3120851 Forward-Port-Of: odoo/enterprise#35262
Original PR description
…0/Transifex Some translations were lost when we changed version to 16.0 since there is no l10n_* project for 16.0 on Transifex. Reintroduced lost translations for German, Dutch and French. Task: 3120851 Forward-Port-Of: odoo/enterprise#35262
This reduces the feed refresh ribbon height that was too big and lighten its hover/focus color. Technical note: the ribbon uses a bootstrap alert which has more padding in 16.0 than in previous versions. To solve the problem, we have forced the padding to a similar value using a bootstrap class (py-2). Also removed the hover color change (based on color-contrast) because it was not great in dark mode. Task-3105171 Forward-Port-Of: odoo/enterprise#36405
Original PR description
This reduces the feed refresh ribbon height that was too big and lighten its hover/focus color. Technical note: the ribbon uses a bootstrap alert which has more padding in 16.0 than in previous versions. To solve the problem, we have forced the padding to a similar value using a bootstrap class (py-2). Also removed the hover color change (based on color-contrast) because it was not great in dark mode. Task-3105171 Forward-Port-Of: odoo/enterprise#36405
Steps to reproduce: - Install Manufacturing - Manufacturing > Settings > Enable Work Orders - Manufacturing Orders > Create order for Table > Confirm > Work orders tab > Open Tablet View - Get to any step where you register components - Change the quantity to produce - Pause > Continue Issue: The quantity to produce is reset to the original amount. Solution: Do not recompute qty_done when the workorder is paused. Productivity line conditions taken from `_prepare_timeline_vals`
Original PR description
Steps to reproduce: - Install Manufacturing - Manufacturing > Settings > Enable Work Orders - Manufacturing Orders > Create order for Table > Confirm > Work orders tab > Open Tablet View - Get to any step where you register components - Change the quantity to produce - Pause > Continue Issue: The quantity to produce is reset to the original amount. Solution: Do not recompute qty_done when the workorder is paused. Productivity line conditions taken from `_prepare_timeline_vals` opw-3032052 Forward-Port-Of: odoo/enterprise#35867 Forward-Port-Of: odoo/enterprise#34763
8700 Muut liikekulut (other expenses) appears under I.XII.1 Luottotappiot (credit losses), as there is already a dedicated account for that (8730 Myynnin luottotappiot (credit losses on sales)), we add a section for other expenses. opw-2702912 Forward-Port-Of: odoo/enterprise#36389 Forward-Port-Of: odoo/enterprise#35813
Original PR description
8700 Muut liikekulut (other expenses) appears under I.XII.1 Luottotappiot (credit losses), as there is already a dedicated account for that (8730 Myynnin luottotappiot (credit losses on sales)), we add a section for other expenses. opw-2702912 Forward-Port-Of: odoo/enterprise#36389 Forward-Port-Of: odoo/enterprise#35813
Currently, even entries before lock dates are shown with the alert for bank lines not linked to a statement. But they can't modify the lines before lock date so, we should not raise the alert and show them here. task-3135707 Forward-Port-Of: odoo/enterprise#36019
Original PR description
Currently, even entries before lock dates are shown with the alert for bank lines not linked to a statement. But they can't modify the lines before lock date so, we should not raise the alert and show them here. task-3135707 Forward-Port-Of: odoo/enterprise#36019
This commit changes the manifest of the l10n_lu_reports module top include a brief descritpion of the SAF-T file format. task-2667705 Forward-Port-Of: odoo/enterprise#35062
Original PR description
This commit changes the manifest of the l10n_lu_reports module top include a brief descritpion of the SAF-T file format. task-2667705 Forward-Port-Of: odoo/enterprise#35062
Forward-Port-Of: odoo/enterprise#36463
Original PR description
Forward-Port-Of: odoo/enterprise#36463
The `_l10n_mx_edi_cron_update_sat_status` cron has to post lots of requests to the mx gov SAT portal. These post requests can take quite some time and in some cases lead to a TimeoutError and a complete rollback. To avoid losing already posted requests and processed responses the edi.documents to process are split in batch of 50. The transaction is committed after each batch so that the already processed batches are not rollbacked on Timeout. opw-3018561-avd Forward-Port-Of: odoo/enterpri
Original PR description
The `_l10n_mx_edi_cron_update_sat_status` cron has to post lots of requests to the mx gov SAT portal. These post requests can take quite some time and in some cases lead to a TimeoutError and a complete rollback. To avoid losing already posted requests and processed responses the edi.documents to process are split in batch of 50. The transaction is committed after each batch so that the already processed batches are not rollbacked on Timeout. opw-3018561-avd Forward-Port-Of: odoo/enterprise#34521