Commit Graph
27 Commits
Author SHA1 Message Date
Joseph Caburnay 123b705677 [FIX] pos_discount: pos app is stuck when changing the discount
To reproduce:
1. Install pos_discount and pos_coupon.
2. Start a session and add item to the order.
3. Add global discount.
4. Change global discount. Stuck.

This is because in some modules, get_orderlines is overridden. Instead
of returning the original object containing the orderlines, it returns
a different array instance containing the lines. This is the reason the
while loop is stuck. With this change, whether get_orderlines return the
container or a copy, we are sure that it won't be stuck in the for loop.

closes odoo/odoo#81011

Task-id: 2697861
X-original-commit: 6d78748794a2db3f324312fc773f7a48fd0ffba4
Signed-off-by: Masereel Pierre <pim@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2021-12-07 19:27:40 +00:00
Jacky (trj) 13843f8545 [IMP]: point_of_sale UI: NumberPopup and NumberBuffer can pre-select input which will change the value upon triggering a key
The user doesn't need to delete the current input before changing it. He can now write
hiw new value which will erase the current one.
The guest popup from the `pos_restaurant` module and the global discount popup from the
`pos_discount` module benefit from this and have their input pre-selected.

Before: when opening the guest or discount popup, the user always has to delete the curent
value before changing it. Let's say that the current value was `5`, the user needs to either
press the `Delete` or `Backspace` button/key before entering his new value.

After: the user doesn't need to press the `Delete` or `Backspace` button/key and can now directly
enter his new value

Task ID: 2419637
2021-02-25 09:47:50 +00:00
Pierre Masereel cd61b662e7 [FIX] point_of_sale: discount product with tax
When you are using a discount product with a tax, you get a traceback
when trying to add the discount. It is caused by a typo and is fixed
here.

closes odoo/odoo#63550

X-original-commit: b389dcabf49fd05c5239d68fd26ef4239963a7e5
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-12-17 16:14:08 +00:00
Pierre Masereel eabbd3558f [REF] pos_discount: migration to OWL framework 2020-05-12 12:52:23 +00:00
Andrea Grazioso (agr-odoo) f0afe7420a [FIX] pos_discount: correctly get discount amount
Activate a language which has comma as decimal separator
Go into POS settings, activate 'Global Discount'.
Open POS session, add some product and use global discount.
Input some number with decimals and confirm.
Discount will be not applied

This occur because of javascript type coercion:
 Math.min(100, "11.0") -> 11
 Math.min(100, "11,0") -> NaN

So in locales with thousands separator the statement would produce
different results. Forcing float parsing fix the issue

opw-2243482

closes odoo/odoo#50900

X-original-commit: 84a6c2a59c59b88b0ad7b1f9112d331fa2a505c5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-05-08 09:31:12 +00:00
Pierre Masereel 11b23d3771 [FIX] pos_discount: don't show multiple prices
When you add a discount, the price is changed on the product, and so
when you have enabled options to display the discount, the product is
shown as discounted. So we are modifying the lst_price too (like for
tip) to avoid having differences between prices.

closes odoo/odoo#37089

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-09-18 14:20:25 +00:00
Pierre Masereel e09d7d1b25 [FIX] pos_discount: get price based on total without tax
When you are applying a discount, the base amount is the one tax
included which is wrong as we'll apply the tax of the discount product
on it. So we are basing the discount computation on the total without
taxes and then apply the tax configured on the product.

It doesn't work with multiple taxes, but will be handled in future
developement in odoo.

closes odoo/odoo#36798

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-09-12 14:17:50 +00:00
Pierre Masereel ab0a207a59 [FIX] point_of_sale: force load discount product
When you set up a discount product on your pos config and also some
available categories, it is possible that the discount product is not
loaded in the point of sale, which lead to an error.

Now we are forcing the loading of the discount product to allow using it
even if it is not in the allowed categories, as we don't want to create
a discount product for each category if we want to use both features.

TASK-ID: 2057436
2019-08-27 09:31:31 +00:00
Nicolas Martinelli 7670c6c80a [FIX] pos_discount: change customer
- Enable general discounts for POS
- Create a POS session
- Add a product
- Create a general discount of 10%
- Change the customer

The discount is reset to the product price.

When changing the customer, the prices are reset:

https://github.com/odoo/odoo/blob/3b1699e02d4483913159681bf7e10839e6493244/addons/point_of_sale/static/src/js/screens.js#L1251

In the case of a global discount, the price is therefore reset to the
product price in:

https://github.com/odoo/odoo/blob/3b1699e02d4483913159681bf7e10839e6493244/addons/point_of_sale/static/src/js/models.js#L2304

To avoid this, we set the price as manually set. Conceptually, this is
indeed the case since we manually chose the percentage, therefore the
price.

opw-2009761

closes odoo/odoo#34416

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-06-27 11:51:54 +00:00
kujiu f90cf060a3 [FIX] Syntax of icons (#25577)
Description of the issue/feature this PR addresses:

Accessibility improvements forbids the use of the syntax
`<i class="fa fa-check"/> Some text`
to create a labelled icon. But, by this, some fonts are changed.

Desired behavior after PR is merged:
The old syntax can be used.
2018-07-04 09:55:52 +02:00
kujiu 9de1bc0eef [IMP] Improve compatibility with screen readers (accessibility) (#24574)
Today, Odoo is really tricky to use without seeing the screen, it must be improved to be usable.

This PR forbid to use labels without a "for" attribute, add some title, rule and aria attributes in HTML. With that, Odoo will be fully usable with a screen reader.


* [IMP] Labels must have a for attribute. Improve accessibility.
* [IMP] Better error message when trying to read a missing cached value
* [FIX] Add some aria-label and title attributes for screen readers.
* [FIX] Template name is not included in the error message in case of SyntaxError in QWeb
* [FIX] Improve the Tour failed at step error message to be more explicit.
* [IMP] Add aria-labels
* [FIX] Add missing aria-label on failing test
* [IMP] aria-hidden means hidden. Fix all bad aria-hidden and hide aria-hidden for all.
* [IMP] Color names on kanban views and many2many tags
* [IMP] Add some checks on views for accessibility.
* [IMP] Add `alt` attribute on `img` tags.
* [IMP] Add aria-label and title on non-described icons
* [IMP] Add button role to widgets with btn class
* [IMP] Translate aria and formatted attributes.
* [IMP] Remove wrong aria-labelledby
* [IMP] Add menu role on dropdowns
* [IMP] Buttons must be focusable
* [IMP] Add aria attributes on progress bars
* [IMP] Improve accessibility of basic widgets
* [IMP] Change main layout to more semantic tags
* [IMP] Add menuitem role when missing
* [IMP] Remove wrong role='presentation'
* [IMP] Improve accessibility of tab panels
* [IMP] Add aria-invalid on invalid fields
* [IMP] Add aria-sort on ordered columns
* [IMP] Add role on alerts
* [IMP] Use dialog role, header, main and footer tags for modals
* [IMP] Add labels on o_status
* [IMP] Improve accessibility of kanban view with feeds and articles
* [IMP] Add alerts in case of new messages
* [IMP] Add widget, navigation or img role to aria-labelled items
2018-06-22 21:22:21 +02:00
Dinar b3aeb3b2e7 [IMP] pos_discount: possibility to redefine the discount button
Was not able to make inheritance of  POS Discount objects via "extend" or
"include" functions

Closes #25227
2018-06-13 15:47:09 +02:00
Nicolas Martinelli 075f13ac63 [FIX] pos_discount: error if misconfigured product
In case the discount product is misconfigured and therefore not loaded
by the POS, a traceback appears when applying a discount.

Add a comprehensive error message instead.

opw-817527
2018-02-22 11:01:40 +01:00
Christophe Simonis 42264d8dcb [MERGE] forward port branch saas-16 up to 5d7ad2b16c 2017-11-30 18:43:08 +01:00
Nicolas Martinelli 5548b2ff7a [FIX] pos_discount: missing translation
opw-783101
2017-11-23 15:40:42 +01:00
Mansi Gandhi 80e89c7a11 [IMP] point_of_sale: Add new settings form per POS
Purpose: Replace POS APP settings with a clean POS Form settings,
         one per POS

    - add state button for (active/inactive) archive/unarchive and remove boolean field.
    - remove 'Reprint Receipt' field from pos_reprint module and related code.
    - remove 'Multi-currencies' field and related code.
    - put 'Company' field under the 'Taxes' block and 'Sales Channel' under the 'Pricing' block.
    - add 'save' buttons to install needed modules manually.
    - removed constrains and set default fiscal value on fiscal position ids even if that not selected.
    - change the skip Receipt Screen label to a more appropriate one.
    - Tax help only appears when Tax-included is selected.

    * [IMP] point_of_sale: Removing multiple prices prod

    Purpose: The choice of the method for "Multiple price per product" was
    not appropriate for the Point Of Sale. Only the choice of the Pricelist
    make sense. So, only the Pricelist can be choosen in the POS config.

    * [IMP] point_of_sale, pos_discount, pos_restaurant:
            Generic module install

    Purpose: Before this improvement, some fields were used in pos.config to
             automatically install some modules.
             This fix tries to mimic the ResConfigSettings transient so that
             when a field starts with 'module_', it's automaticaly
             installed.
2017-08-07 14:24:45 +02:00
Virbhadrasinh Gohil 95e5a630b1 [MOV] pos_discount: Rearranged files according to file structure 2016-04-07 14:34:29 +02:00
Mahendra barad 727f7c4175 [FIX] point_of_sale : Prevent a traceback when adding a global discount on an empty pos, allow use of a numeric pad dot (.) in payment screen. 2015-09-21 12:53:32 +02:00
Géry Debongnie 4fdf74fe21 [IMP] web+addons: improvement to module system
The module system needs to know the dependencies of a given module
before executing the function.  This is why the dependencies were
defined once in an array, and then were described one more times in the
call to require.

But a trick can simplify this: the boot function can parse the string
representation of the module and extract the calls to require from it.
It is more work for the processor, but it leads to simpler module
definitions.
2015-03-18 09:23:37 +01:00
Géry Debongnie 90050c24bb [REF] pos_X: update to the new module system 2015-03-18 09:09:22 +01:00
Frédéric van der Essen 479ba22b5c [IMP] pos_discount: variable percentage on order discounts 2015-03-03 11:11:55 +01:00
Frédéric van der Essen 01c713aab0 [IMP] pos_discount: load the client side QWeb templates with the module manifest 2015-01-21 12:20:35 +01:00
Frédéric van der Essen 5a8838243d [WIP] point_of_sale, pos_restaurant: continued refactor
- this time it's the restaurant module that has been refactored
 - the point of sale extensions points have been reviewed to be more
   constistent and allow conditional extensions.
 - the chrome subwidgets are instanciated before screens, so that
   screens can manipulate them if needed.
2014-12-31 15:34:32 +01:00
Frédéric van der Essen c1eb6d608c [WIP] point_of_sale, pos_discount: action buttons + adapt the pos_discount code after pos refactor 2014-12-31 15:34:32 +01:00
Frederic van der Essen 44253541e5 [IMP] point_of_sale, pos_*: unpaid orders are saved in localstorage and persist between reloads
Conflicts:
	addons/point_of_sale/static/src/js/models.js
	addons/point_of_sale/static/src/js/screens.js
	addons/pos_restaurant/static/src/js/multiprint.js
	addons/pos_restaurant/static/src/js/notes.js

Conflicts:
	addons/point_of_sale/static/src/js/models.js
	addons/point_of_sale/static/src/js/screens.js
	addons/point_of_sale/static/src/xml/pos.xml
2014-11-26 11:40:17 +01:00
Frederic van der Essen 01f8a6a59a [IMP] pos_discount: add an icon to the discount button 2014-07-28 13:33:54 +02:00
Frederic van der Essen dfd9f164a2 [IMP] pos_discount: a new pos extension that allows you to quickly give a global discount on the current order 2014-07-24 18:08:12 +02:00