Nicolas Martinelli e3b22264d8 [FIX] point_of_sale: mix of sale and refund
- Set rounding policy to 'Round Globally'
- Create a Tax T
  Amount: 21.0%
  Different tax tags for invoice and credit notes
  Set any account Repartition Line
  Advanced Options => Included in Price
- Create a Product P1
  Sales Price: 11.8
  Customer Taxes: T
- Create a Product P2
  Sales Price: 15.3
  Customer Taxes: T
- Create a new POS Session
- Create a POS order:
  P1, Quantity: -6, Discount: 5%
  P2, Quantity: 6, Discount: 5%
- Validate and close the session

A difference of 0.01 prevents from closing the session.

The error arises because the tax tags are different for an invoice and a
refund. In the following:
https://github.com/odoo/odoo/blob/1a9e147639012cc847099e69fc964f3669a36cbb/addons/point_of_sale/models/pos_session.py#L394

Both lines have different `tag_ids`, therefore their amount is not
summed when closing the session. On the other hand, the POS UI is not
aware of the `tag_ids`, so it sums then round the amounts.

The situation is quite unusual: from SO or Invoices, it is possible to
create either an invoice or a refund, but not a mixed object as the POS
is doing. Moreover, if a user invoices the POS order, there is no
problem to close the session since a regular invoice is created and tax
amounts are summed.

We consider a refund if all lines have negative quantities. We only do
it in 'Round Globally' configuration to avoid impacting non-problematic
use cases.

opw-2254211

closes odoo/odoo#52704

X-original-commit: 5f25be8eef9a9efc18a995f2c6405d08a657ac96
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-06-09 12:46:18 +00:00
2020-06-09 00:30:55 +00:00
2020-06-09 00:30:55 +00:00
2020-04-20 11:41:39 +00:00
…
…
…
…
…

Build Status Tech Doc Help Nightly Builds

Odoo

Odoo is a suite of web based open source business apps.

The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...

Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.

Getting started with Odoo

For a standard installation please follow the Setup instructions from the documentation.

To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials

S
Description
No description provided
Readme LGPL-3.0
3.4 GiB
Languages
Python 49.6%
JavaScript 47.8%
SCSS 2%
CSS 0.3%
HTML 0.2%