From 225fb81cc0e7d44678f2b53a9722f5dbd28a9bf6 Mon Sep 17 00:00:00 2001
From: Adrien Widart <awt@odoo.com>
Date: Wed, 1 Sep 2021 09:21:41 +0000
Subject: [PATCH] [FIX] point_of_sale: remove monetary widget of discount field

Considering the field declaration:
https://github.com/odoo/odoo/blob/fe5deb4ee4c8e07aed2f2cff6210271bfaa61476/addons/point_of_sale/models/pos_order.py#L1121
`discount` is a rate, not an amount. Therefore, suppose a discount of
10%, when opening a POS-generated SO, the discount shouldn't be "$10".

OPW-2629493

closes odoo/odoo#75907

X-original-commit: 666955cb630640384c5ca1f0e13e13b5253c3c58
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
---
 addons/point_of_sale/views/pos_order_view.xml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/addons/point_of_sale/views/pos_order_view.xml b/addons/point_of_sale/views/pos_order_view.xml
index 01b4cfc6e29a..8439b8c28905 100644
--- a/addons/point_of_sale/views/pos_order_view.xml
+++ b/addons/point_of_sale/views/pos_order_view.xml
@@ -41,7 +41,7 @@
                                 <field name="qty"/>
                                 <field name="product_uom_id" string="UoM" groups="uom.group_uom"/>
                                 <field name="price_unit" widget="monetary"/>
-                                <field name="discount" string="Disc.%" widget="monetary"/>
+                                <field name="discount" string="Disc.%"/>
                                 <field name="tax_ids_after_fiscal_position" widget="many2many_tags" string="Taxes"/>
                                 <field name="tax_ids" widget="many2many_tags" invisible="1"/>
                                 <field name="price_subtotal" widget="monetary" force_save="1"/>
@@ -51,7 +51,7 @@
                                 <group col="4">
                                     <field name="product_id"/>
                                     <field name="qty"/>
-                                    <field name="discount" widget="monetary"/>
+                                    <field name="discount"/>
                                     <field name="price_unit" widget="monetary"/>
                                     <field name="price_subtotal" invisible="1" widget="monetary" force_save="1"/>
                                     <field name="price_subtotal_incl" invisible="1" widget="monetary" force_save="1"/>
@@ -248,7 +248,7 @@
             <tree string="POS Order lines">
                 <field name="product_id" readonly="1"/>
                 <field name="qty" readonly="1" sum="Total qty"/>
-                <field name="discount" readonly="1" widget="monetary"/>
+                <field name="discount" readonly="1"/>
                 <field name="price_unit" readonly="1" widget="monetary"/>
                 <field name="price_subtotal" readonly="1" sum="Sum of subtotals" widget="monetary"/>
                 <field name="price_subtotal_incl" readonly="1" sum="Sum of subtotals" widget="monetary"/>
@@ -265,7 +265,7 @@
                 <group col="4">
                     <field name="product_id" />
                     <field name="qty" />
-                    <field name="discount" widget="monetary"/>
+                    <field name="discount"/>
                     <field name="price_unit" widget="monetary"/>
                     <field name="create_date" />
                 </group>
-- 
GitLab