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.
closesodoo/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>
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
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.
closesodoo/odoo#63550
X-original-commit: b389dcabf49fd05c5239d68fd26ef4239963a7e5
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
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
closesodoo/odoo#50900
X-original-commit: 84a6c2a59c59b88b0ad7b1f9112d331fa2a505c5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
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.
closesodoo/odoo#37089
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
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.
closesodoo/odoo#36798
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
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
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.
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
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
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.
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.
- 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.