Thursday, May 16, 2024
1 change · saas-17.2
Resolved issues and error corrections
This fixes an error that prevented order validation in German Point of Sale setups using fiskaly certification. Businesses can now complete sales normally while keeping the required German POS certification flow working.
Original PR description
Currently, when validating an order, an error appears. Steps to reproduce: ------------------- * Install **l10n_de_pos_cert** and set up **fiskaly** * Set up **PoS** in German company * Open a store…
Currently, when validating an order, an error appears.
Steps to reproduce:
-------------------
* Install **l10n_de_pos_cert** and set up **fiskaly**
* Set up **PoS** in German company
* Open a store session
* Validate an order
> Unknown Error: An unknown error has occured! Please, contact Odoo.
Why the fix:
------------
https://github.com/odoo/enterprise/blob/a8bd649f7b4c5c3af64edaca19b9c8ca9999cd9e/l10n_de_pos_cert/static/src/overrides/models/models.js#L184-L186
Function `get_tax_details()` was changed with
https://github.com/odoo/odoo/commit/ab0bdf0192120671010634978f202da35ddfc79f
It was previously returning an object of the form
```js
amount: 56.050000000000004
base: 295
name: "19%"
tax: Proxy(AccountTax)
amount: 19
amount_type: "percent"
children_tax_ids: []
company_id: Base {models: {…}, records: Proxy(Object), model: {…}, _raw: {…}, id: 3, …}
id: 16
include_base_amount: false
is_base_affected: true
model: {…}
models: {pos.config: {…}, pos.order: {…}, pos.order.line: {…}, pos.session: {…}, pos.payment.method: {…}, …}
name: "19%"
price_include: false
```
And now returns
```js
amount: 56.050000000000004
amount_type: "percent"
base: 295
batch_indexes: [0]
display_base: 295
evaluation_context: {multiplicator: 0.19}
extra_base_for_base: []
extra_base_for_tax: []
id: 16
include_base_amount: false
index: 0
is_base_affected: true
name: "19%"
price_include: false
sequence: 10
tag_ids: []
tax_amount: 56.05
tax_amount_factorized: 56.050000000000004
tax_exigibility: "on_invoice"
tax_ids: []
tax_percentage: 19
```
`details.tax.id` is now simply `details.id` and `details.tax.amount` is `details.tax_percentage`. As per the following definition: https://github.com/odoo/odoo/blob/5058c01974431af1cb3a59d65bf40cf5b08ba4ea/addons/point_of_sale/static/src/app/store/models.js#L2202-L2209
opw-3924715