<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Odoo/addons/point_of_sale/static/src/js, branch 14.0</title>
<subtitle>The current checkout of upstream Odoo</subtitle>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/'/>
<entry>
<title>[FIX] point_of_sale: print not working in Mobile App</title>
<updated>2021-05-31T09:01:08+00:00</updated>
<author>
<name>Romeo Fragomeli</name>
<email>rfr@odoo.com</email>
</author>
<published>2021-04-30T08:46:41+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=a11662e525aad9a843acf54b717f3df18d8c2cab'/>
<id>a11662e525aad9a843acf54b717f3df18d8c2cab</id>
<content type='text'>
Before this commit, "document.execCommand" was first
method used when attempting to print, due to a bug
in Safari for Windows (ndr. which is deprecated as
the last version of Safari for Windows is 5.1.7
from may 2012).

On the mobile App, the "document.execCommand('print')"
call returns "true" even if nothing has actually been
done, which therefore prevents from executing "window.print()".

After this commit, we execute directly "window.print()"
as it's supported by all modern browsers (except Firefox Android,
which doesn't support printing at all).

Notes:
* "document.execCommand" is deprecated and the "print" command isn't even documented
* Safari 5.1.7 doesn't support Promise/Async/Await, and therefore not Odoo 13+.

References:
* https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand
* https://developer.mozilla.org/en-US/docs/Web/API/Window/print
* https://caniuse.com/?search=await
* https://caniuse.com/?search=promise
* https://apple.stackexchange.com/questions/68836/where-can-i-download-safari-for-windows

opw-2486818

closes odoo/odoo#70155

Signed-off-by: Pierre Paridans &lt;pparidans@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before this commit, "document.execCommand" was first
method used when attempting to print, due to a bug
in Safari for Windows (ndr. which is deprecated as
the last version of Safari for Windows is 5.1.7
from may 2012).

On the mobile App, the "document.execCommand('print')"
call returns "true" even if nothing has actually been
done, which therefore prevents from executing "window.print()".

After this commit, we execute directly "window.print()"
as it's supported by all modern browsers (except Firefox Android,
which doesn't support printing at all).

Notes:
* "document.execCommand" is deprecated and the "print" command isn't even documented
* Safari 5.1.7 doesn't support Promise/Async/Await, and therefore not Odoo 13+.

References:
* https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand
* https://developer.mozilla.org/en-US/docs/Web/API/Window/print
* https://caniuse.com/?search=await
* https://caniuse.com/?search=promise
* https://apple.stackexchange.com/questions/68836/where-can-i-download-safari-for-windows

opw-2486818

closes odoo/odoo#70155

Signed-off-by: Pierre Paridans &lt;pparidans@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] point_of_sale: random failure when reprint receipt</title>
<updated>2021-05-20T10:29:04+00:00</updated>
<author>
<name>Jacky (trj)</name>
<email>trj@odoo.com</email>
</author>
<published>2021-05-20T08:01:28+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=a54d54c9c479aaee3bafe6e241d89d557a1e0b56'/>
<id>a54d54c9c479aaee3bafe6e241d89d557a1e0b56</id>
<content type='text'>
Because the `receiptHtml` was taken from a component which was mounted outside of the DOM, it was hardly ever destroyed for some unknown reasons and the `el.outerHTML` could not be taken to create the receipt.

closes odoo/odoo#71087

Signed-off-by: pimodoo &lt;pimodoo@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Because the `receiptHtml` was taken from a component which was mounted outside of the DOM, it was hardly ever destroyed for some unknown reasons and the `el.outerHTML` could not be taken to create the receipt.

closes odoo/odoo#71087

Signed-off-by: pimodoo &lt;pimodoo@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] point_of_sale: Fix down/up rounding</title>
<updated>2021-05-26T14:09:20+00:00</updated>
<author>
<name>Robin Heinz</name>
<email>rhe@odoo.com</email>
</author>
<published>2021-05-25T12:29:44+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=bfccdf07adba35a5838a35a7bba98a1d71c67d2f'/>
<id>bfccdf07adba35a5838a35a7bba98a1d71c67d2f</id>
<content type='text'>
While using the cash rounding, there were issues when rounding up and down.
The pre filled amount was correct but the rest of the transaction was wrong. (Wrong due, wrong change,...)
This commit re calculate the rounding applied when using up or down payment.

closes odoo/odoo#71219

Signed-off-by: pimodoo &lt;pimodoo@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While using the cash rounding, there were issues when rounding up and down.
The pre filled amount was correct but the rest of the transaction was wrong. (Wrong due, wrong change,...)
This commit re calculate the rounding applied when using up or down payment.

closes odoo/odoo#71219

Signed-off-by: pimodoo &lt;pimodoo@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] point_of_sale: Load all existing Payment Method but displayed linked ones</title>
<updated>2021-05-26T13:06:44+00:00</updated>
<author>
<name>Robin Heinz</name>
<email>rhe@odoo.com</email>
</author>
<published>2021-05-26T07:56:47+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=e44219b1cdb80d37b557ff74767f5f3e5aca5072'/>
<id>e44219b1cdb80d37b557ff74767f5f3e5aca5072</id>
<content type='text'>
Before, when using the manage order, if a payment method was used and then removed from the pos.config,
we couldn't load the old order anymore because of unknow reference.
To fix this, we load all methods at the opening of the pos but when we display the payment methods we only show those in the pos.config.

closes odoo/odoo#71263

Task-id: 2541708
Signed-off-by: pimodoo &lt;pimodoo@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before, when using the manage order, if a payment method was used and then removed from the pos.config,
we couldn't load the old order anymore because of unknow reference.
To fix this, we load all methods at the opening of the pos but when we display the payment methods we only show those in the pos.config.

closes odoo/odoo#71263

Task-id: 2541708
Signed-off-by: pimodoo &lt;pimodoo@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] point_of_sale: show pack lot input popup when scanning product</title>
<updated>2021-05-25T09:44:54+00:00</updated>
<author>
<name>Joseph Caburnay</name>
<email>jcb@odoo.com</email>
</author>
<published>2021-05-25T09:26:16+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=ff58fb0fb588092f1d02500cd000d20a3f8b67b7'/>
<id>ff58fb0fb588092f1d02500cd000d20a3f8b67b7</id>
<content type='text'>
When scanned product is tracked by lot or SN, the popup that asks
for lot should be shown, just like as when a tracked product is clicked
from the product list.

We accomplish this by introducing a new method that can be used both
by `_clickProduct` and `_barcodeProductAction`, and by making the
`_barcodeProductAction` be independent from `scan_product` method
from `PosModel`. So instead of calling directly `scan_product`, we
indentify the product first based on the barcode, then we call the
newly introduced method to ask for the lot inputs, then we call
`add_product` with proper options including the type of the parsed
barcode.

closes odoo/odoo#71209

Signed-off-by: pimodoo &lt;pimodoo@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When scanned product is tracked by lot or SN, the popup that asks
for lot should be shown, just like as when a tracked product is clicked
from the product list.

We accomplish this by introducing a new method that can be used both
by `_clickProduct` and `_barcodeProductAction`, and by making the
`_barcodeProductAction` be independent from `scan_product` method
from `PosModel`. So instead of calling directly `scan_product`, we
indentify the product first based on the barcode, then we call the
newly introduced method to ask for the lot inputs, then we call
`add_product` with proper options including the type of the parsed
barcode.

closes odoo/odoo#71209

Signed-off-by: pimodoo &lt;pimodoo@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] point_of_sale: compare the quantity to number type</title>
<updated>2021-05-25T09:44:54+00:00</updated>
<author>
<name>Joseph Caburnay</name>
<email>jcb@odoo.com</email>
</author>
<published>2021-05-25T09:17:57+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=02d9b51e43904420afe31e1f65ea455e3ed2c8ea'/>
<id>02d9b51e43904420afe31e1f65ea455e3ed2c8ea</id>
<content type='text'>
When identifying whether to show the decrease quantity popup or not,
the current quantity of the selected orderline is compared to the
new input quantity. This fix properly compares the current quantity
to the new input quantity in number format.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When identifying whether to show the decrease quantity popup or not,
the current quantity of the selected orderline is compared to the
new input quantity. This fix properly compares the current quantity
to the new input quantity in number format.</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] point_of_sale: dot input should be recognized even at different lang</title>
<updated>2021-05-25T09:44:54+00:00</updated>
<author>
<name>Joseph Caburnay</name>
<email>jcb@odoo.com</email>
</author>
<published>2021-05-25T09:05:39+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=a37935b466e3d74e08d5ea41047185144e8e5b6f'/>
<id>a37935b466e3d74e08d5ea41047185144e8e5b6f</id>
<content type='text'>
Language such as FR recognizes `,` as the decimal separator. However, it is
possible that the keyboard setting is American so the decimal point in the
numpad will send `.` when pressing it. POS should be able to recognize both.
This fix allows `.` sent from keyboard to be interpreted as decimal separator
even at language where the decimal separator is `,`. This is okay because
number inputs in POS doesn't take into account the thousand separator.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Language such as FR recognizes `,` as the decimal separator. However, it is
possible that the keyboard setting is American so the decimal point in the
numpad will send `.` when pressing it. POS should be able to recognize both.
This fix allows `.` sent from keyboard to be interpreted as decimal separator
even at language where the decimal separator is `,`. This is okay because
number inputs in POS doesn't take into account the thousand separator.</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] point_of_sale: rounding down near 0</title>
<updated>2021-05-17T17:36:05+00:00</updated>
<author>
<name>Nicolas Lempereur</name>
<email>nle@odoo.com</email>
</author>
<published>2021-05-17T14:57:45+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=23dd2ea535bea0a57dcac773a81e202135cd2ed6'/>
<id>23dd2ea535bea0a57dcac773a81e202135cd2ed6</id>
<content type='text'>
Before 03025520b rounding applied was eg. for these numbers and UP and
DOWN rounding methods to multiple of 10:

```
Numbers | -8 | -2 |  2 |  8 | 12
DOWN    | -2 | -8 | -2 | -8 | -2
UP      |  8 |  2 |  8 |  2 |  8
```

which is correct for positive numbers but UP and DOWN are inversed for
negatives numbers.

After 03025520b this became:

```
Numbers | -8 | -2 |  2 |  8 | 12
DOWN    |  8 |  2 |  8 | -8 | -2
UP      | -2 | -8 | -2 |  2 |  8
```

which is correct for all cases except for positive numbers that are
before HALF of the precision (eg. number 2) for which UP and DOWN are
inversed.

This is happening because 03025520b uses the sign of the rounded value
=&gt; this does not work for 0 so number 2 is broken (and if fixed number
-2 would be broken).

With this commit, the adjustement of sign is done based on original
number, so we get the equivalent of python equivalent methods:

```
Numbers | -8 | -2 |  2 |  8 | 12
DOWN    |  8 |  2 | -2 | -8 | -2
UP      | -2 | -8 |  8 |  2 |  8
```

opw-2451841

closes odoo/odoo#70910

Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Before 03025520b rounding applied was eg. for these numbers and UP and
DOWN rounding methods to multiple of 10:

```
Numbers | -8 | -2 |  2 |  8 | 12
DOWN    | -2 | -8 | -2 | -8 | -2
UP      |  8 |  2 |  8 |  2 |  8
```

which is correct for positive numbers but UP and DOWN are inversed for
negatives numbers.

After 03025520b this became:

```
Numbers | -8 | -2 |  2 |  8 | 12
DOWN    |  8 |  2 |  8 | -8 | -2
UP      | -2 | -8 | -2 |  2 |  8
```

which is correct for all cases except for positive numbers that are
before HALF of the precision (eg. number 2) for which UP and DOWN are
inversed.

This is happening because 03025520b uses the sign of the rounded value
=&gt; this does not work for 0 so number 2 is broken (and if fixed number
-2 would be broken).

With this commit, the adjustement of sign is done based on original
number, so we get the equivalent of python equivalent methods:

```
Numbers | -8 | -2 |  2 |  8 | 12
DOWN    |  8 |  2 | -2 | -8 | -2
UP      | -2 | -8 |  8 |  2 |  8
```

opw-2451841

closes odoo/odoo#70910

Signed-off-by: Nicolas Lempereur (nle) &lt;nle@odoo.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[REF] point_of_sale + pos_restaurant: adjusted code for German POS localization</title>
<updated>2021-04-08T12:41:56+00:00</updated>
<author>
<name>Jacky (trj)</name>
<email>trj@odoo.com</email>
</author>
<published>2021-01-27T15:10:36+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=455f49fe74611849ee1ff6addc875352d1b6c386'/>
<id>455f49fe74611849ee1ff6addc875352d1b6c386</id>
<content type='text'>
These changes have been made to be able to add some behaviors in some specific points of the flow when overridden.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These changes have been made to be able to add some behaviors in some specific points of the flow when overridden.</pre>
</div>
</content>
</entry>
<entry>
<title>[FIX] point_of_sale: rounding issue with cash rounding</title>
<updated>2021-05-16T17:50:51+00:00</updated>
<author>
<name>Pierre Masereel</name>
<email>pim@odoo.com</email>
</author>
<published>2021-05-12T16:15:48+00:00</published>
<link rel='alternate' type='text/html' href='http://erp.ceuconsult.com:9000/Odoo/commit/?id=af5a88e84fb1c05c4be38930373165f28a06f4f0'/>
<id>af5a88e84fb1c05c4be38930373165f28a06f4f0</id>
<content type='text'>
The method that computs what is due and the change of an order is based
on the selected payment line which is wrong, because if you add and
remove a payment line, none will be seleced, that lead to issue in this
case because a change is computed, and it won't match the invoices
because an amount_return is sent to server.

To reproduce you can follow this simply procedure:
    - set rounding half-up to 0.05
    - create a product at 0.98
    - open POS and create an order with the product
    - go to payment screen
    - add cash payment (1€ auto filled)
    - add bank payment (It'll autofill -0.02 not really a problem)
    - remove the bank payment =&gt; It'll show 0.02 due (it is caused because of no payment method is selected)
    - Set a customer and check the invoice =&gt; unbalanced (0.02 probably because it is set in amount_return of the request)

closes odoo/odoo#70825

Signed-off-by: pimodoo &lt;pimodoo@users.noreply.github.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The method that computs what is due and the change of an order is based
on the selected payment line which is wrong, because if you add and
remove a payment line, none will be seleced, that lead to issue in this
case because a change is computed, and it won't match the invoices
because an amount_return is sent to server.

To reproduce you can follow this simply procedure:
    - set rounding half-up to 0.05
    - create a product at 0.98
    - open POS and create an order with the product
    - go to payment screen
    - add cash payment (1€ auto filled)
    - add bank payment (It'll autofill -0.02 not really a problem)
    - remove the bank payment =&gt; It'll show 0.02 due (it is caused because of no payment method is selected)
    - Set a customer and check the invoice =&gt; unbalanced (0.02 probably because it is set in amount_return of the request)

closes odoo/odoo#70825

Signed-off-by: pimodoo &lt;pimodoo@users.noreply.github.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
