Commit Graph
163 Commits
Author SHA1 Message Date
Pierre Masereel dd2aaf0b1d [IMP] point_of_sale: Ship products later
For now, when you are selling products in the point of sales, the stock
is affected once the order is validated or the session closed. But in
some case, you don't have the product in your store, and you have to
plan a delivery for the order.

To be able to plan a delivery, you can now choose the warehouse in POS
Config and the routes of your warehouse will be applied. You can also
set a specific rule on your POS Config if you've enabled the
multi-step-routes in the inventory module

closes odoo/odoo#58506

Task-id: 2082104
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-01-27 10:46:13 +00:00
nie 5e9e93ca6c [FIX] point_of_sale: cannot close rescue session with Cash Control
Steps:
- Go to Point of Sale > Shop > Settings
- Activate "Advanced Cash Control"
- Start a new Shop session
- Once in the POS go offline
- Create some orders
- Close the POS UI in the top-right corner
- Go back online
- Close the session and post the entries
- Start a new session
- Create an order
- Close the POS UI
- Close the session and post the entries
- Go to Orders > Sessions
- Click the rescue session
- Click "Continue Selling"

Bug:
The user is redirected to the POS dashboard instead of opening the UI.

Explanation:
First, you cannot "Continue Selling" in a rescue session as seen here:
https://github.com/odoo/odoo/blob/b826c96ad39fc887a735c6ca839e3796aa18dac5/addons/point_of_sale/controllers/main.py#L17-L22
This commit removes the button from the UI in this case.

Then, after it has been created, the rescue session should be open and
not in the 'opening_control' state as seen here:
https://github.com/odoo/odoo/blob/9a8ebcc7cb05572681444ddb2511ccea4cee5565/addons/point_of_sale/models/pos_order.py#L98-L99
This is not the case anymore since https://github.com/odoo/odoo/commit/d21420d87ad8a269a0f30b3d9c0a3cee8c46cb14

opw:2427972

closes odoo/odoo#64705

X-original-commit: 71b342b8e16973eae9fdc3484b88ed135c5d2834
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-01-18 16:17:49 +00:00
jev 4f45e5ea2e [FIX] point_of_sale: already reconciled stock_account_move_line
When the customer use Anglo-Saxon stock valuation and have already
reconciled some `account.move.line` related to an open `pos.session`,
closing the session will fail.
(You are trying to reconcile some entries that are already reconciled)

Now, the reconciled lines are ignored.
The inventory valuation is still correct as these lines were already
reconciled.

opws:
2374559
2376187
2377958
2391395
2425197

closes odoo/odoo#64668

X-original-commit: 3f939af62df65dcb9c8cdd2ecc3ac3d4c2983a2f
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-01-18 10:53:23 +00:00
Andrea Grazioso (agr-odoo) ed13ef9df4 [FIX] point_of_sale: add timezone info when registering payment date
Journal entries coming from PoS are based in UTC instead of local time.
This commit is an improvement over 23d3856f2a4323097f51254b5e32c517d45bfe66
to add the timezone info

opw-2371863

closes odoo/odoo#63075

X-original-commit: 30ee2ebae3275de259eff6019d3a4582ef86a729
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-12-09 12:09:00 +00:00
Joseph Caburnay 07aa3a77ab [FIX] point_of_sale: balance pos session move when closing
Instances like deleting a tax used in a pos.order before closing a
session is allowed but it renders error when closing the session
because of imbalance move lines. In this commit, we are adding
a 'balancing' line in the move before it is created. This ensures
the closing of pos session. The introduced move line is named
'Difference at closing PoS session' and is a receivable making it
easy to find and can be reconciled.

closes odoo/odoo#62308

X-original-commit: 7b9545387962981b5729318e2bbc5714dcbac68c
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
2020-11-25 10:26:59 +00:00
Pierre Masereel 183bb633c2 [FIX] point_of_sale: avoid trouble when no chart template installed
When a session is created and no orders can be created because of
misconfiguration. We should be able to close the session.

When a chart of account is installed, we should not try to create
payment methods on config that have active session as it is forbidden.

Check that there is at least one payment method configured when
launching a session.

closes odoo/odoo#61954

X-original-commit: 17bc5d31722c1a90b03ada16f8e100b8713095ca
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-11-18 14:46:11 +00:00
Nicolas Martinelli b0670da86b [FIX] point_of_sale: prevent closing the same session twice
- Create a POS session
- Sell some items
- Close the session, go to the closing page
- Duplicate the browser tab
- Close the session in tab 1
- Close the session in tab 2

The journal entries are created twice.

There should be a server check before closing the session.

opw-2379278

closes odoo/odoo#61860

X-original-commit: 0ba535c5123fecb410fa7546b5bb39a52884ca40
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-11-17 14:11:15 +00:00
Jorge Pinna Puissant 6e594f9537 [FIX] account,point_of_sale: increment customer supplier rank to commercial partner
Before this commit, if a customer/supplier has an invoice address, when
creating an invoice/bill it's the invoice address that will be
identified as the customer/supplier and that will have its rank
increased and not the commercial partner.

Now, the rank increment is done to the commercial partner as well.

opw-2377870

closes odoo/odoo#61778

X-original-commit: dbf042611ccb134a220704d6b775aab650364ca2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-11-16 12:25:34 +00:00
Martin TrigauxandXavier Morel 49838338e0 [FIX] *: sanitize action content reading
The open_action_with_context was not using _for_xml_id, producing an
error when reading the action content.

In open_action, the action_name was taken from the context and needs
sanity checks. Ensure only actions from the account module can be
read and only if the user has access to the target model.
This is a limitation of the previous behaviour but, at the moment, all
known calls are made refering to an action from the account module.
Limit the scope of this method while the 14.0 is still early to avoid
having a door open to ready any action, and difficult to close later.

Remove old action fetching from the context in create_move that is no
longer used.

closes odoo/odoo#61602

X-original-commit: a39e94f7e4dc74e850650ac90bbc5f85af130bc8
Related: odoo/enterprise#14695
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Xavier Morel <xmo@odoo.com>
2020-11-10 16:04:29 +00:00
Laurent Smet a011dcc0bd [FIX] point_of_sale: Always use VAT account for tax lines
As the POS doesn't manage CABA entries, don't use the temporary CABA account.

closes odoo/odoo#61250

X-original-commit: 5f3b8108888d019b0a66b47472b98c04889d343b
Signed-off-by: Josse Colpaert <jco@openerp.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-11-03 11:26:11 +00:00
oco-odoo 2aef5cc5bd [FIX] point_of_sale: use compute_all properly for taxes computation
- Use the tax tags returned by the compute_all for the base lines instead of recomputing them separately

Splitting the computation caused inconsistent computation in some cases between the base and tax lines (one could select the refund distribution, while the other selected the invoice one).

- Pass the is_refund parameter to True if either the quantity or the price is negative (but not both)

Those negative lines should correspond to refund repartition (double-checked with the Belgian tax report in v12).

OPW 2351412

closes odoo/odoo#60925

X-original-commit: 7827581b208b464638a91044462d0bc497025326
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-10-28 17:01:03 +00:00
Andrea Grazioso (agr-odoo) 0e6272819a [FIX] point_of_sale: use payment date for cash statement lines
Open POS
Make some cash transaction
Close POS
Repeat for some days and close the session

Cash statement lines will be saved with the closing date, even
if the payment entries are saved with their payment date

opw-2347645

closes odoo/odoo#60385

Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-10-21 13:24:01 +00:00
Joseph Caburnay ae83889da4 [FIX] point_of_sale: pos User can't close a session
Starting this commit: 8f57863707
regular pos User now don't have a read access to ir.property model.
Because of this, if a user opens a session, he won't be able to close
it. We sudo the search to stock.move (because the query parameters
requires reading from ir.property) to make sure that closing a session
will succeed.

closes odoo/odoo#59712

X-original-commit: 5e2763fdc94b63eee637f9679f8ea3a07beb74ce
Related: odoo/enterprise#13981
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
2020-10-12 07:55:15 +00:00
Andrea Grazioso (agr-odoo) d4d03711c5 [FIX] point_of_sale: partner_id on split move lines
Have a payment method [PAYMENT] on POS with split transactions enabled.
Make a POS sale to a specific customer, pay with [PAYMENT].
Close and validate the session.

While the accounting entry for the POS sale will have the partner set,
this is not the case for the entries related to the payment.

opw-2307973

closes odoo/odoo#56142

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-08-21 09:14:15 +00:00
Antoine Prieels 3f138b9d3c [IMP] point_of_sale, pos_*: Enable HTTPS in POS
HTTPS had been disabled on SaaS to allow the use of the IoT Box that
had no valid SSL certificate. As of V13.0, IoT Boxes connected to
Enterprise DBs have a valid certificate. POS can then use HTTPS.

Nginx is configured to redirect all requests to `/pos/web` to HTTP,
so we change the POS URL to `/pos/ui`, except when using a Six
payment terminal as it only works in HTTP.

closes odoo/odoo#56933

Taskid: 2191878
X-original-commit: 8aee4992778fee5e2f146c4cff8b35e83c7f56b3
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-09-02 10:53:34 +00:00
Antoine Prieels bd0b86d3f8 [IMP] point_of_sale: Split negative and positive anglo saxon lines
A single anglo saxon line was created in the pos.session journal
entries, even if some products were returned. We now distinguish
positive from negative lines.

E.g. Selling 10 Product1 (cost=10) and returning 5 Product1 used to
create the following line:
```
Stock Interim Account (Delivered)          0      50
```
and now creates the following lines:
```
Stock Interim Account (Delivered)          0     100
Stock Interim Account (Delivered)          50     0
```

Task ID: 2126521

closes odoo/odoo#55086

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-07-29 13:59:23 +00:00
Robin Heinz d21420d87a [IMP] point_of_sale: cashbox opening flow.
This commit switch the cash control opening mangement from the backend to the front end of the point of sale.

task_id: 2258817

closes odoo/odoo#55741

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-08-12 12:56:23 +00:00
william 82dc0cb7b9 [IMP] account: soft post entries in the future
Add an easy way to not post the entries in the future when calling
post() on it, but rather set it to be auto-posted at accounting date.
This is useful when we are creating a lot of entries in batch and some
might be in the future, some in the past, and we don't want to separate
that in two batch every time. (asset, accrual, transfer,... )
2020-08-05 11:57:10 +00:00
Nicolas Martinelli 7eaf4f3e36 [FIX] point_of_sale: access error at closing
- Set the following access rights to a user A:
  Point of Sale: User
  Invoicing: Billing
  Inventory: User
- Create a product P, FIFO + Automated
- Add some stock for P
- As user A, open the POS
- Sell one unit of P
- Close the POS and validate entries

An access error is raised because the user doesn't have the right to
read the `stock.valuation.layer` object.

We can retreive the value as `sudo` in this case.

opw-2305446

closes odoo/odoo#55224

X-original-commit: d3147910e031253ddb172959e9016a0f326d7cdb
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-07-30 15:56:11 +00:00
Victor Feyens e8893f84ab [IMP] *: translations improvements
Avoid concatenation of translated strings & raw values and/or other 
translated values, and use the new _ API (by providing the formatting 
values to ensure the fallback on the english terms in case of wrong 
translation).

By including the expected values inside the string to translate, we 
ensure that the formatted values are included at the right place in the 
resulting translated text.

This also provides more information on the string to translate to 
the translators, s.t. the chosen terms for the translations can be more 
adapted to the translation context.

closes odoo/odoo#54635

Related: odoo/enterprise#11925
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-07-23 12:13:19 +00:00
Joseph Caburnay 817ff2d718 [FIX] point_of_sale: unable to close on cash control
Validating the cash register is not needed at this point because it is
already validated in _reconcile_account_move_lines.
2020-06-26 05:40:23 +00:00
Joseph Caburnay 67e148c20f [IMP] point_of_sale: various pos backend views and pos ui improvements
TASK-ID: 2230195
2020-06-26 05:40:23 +00:00
Nicolas Martinelli aa8588e305 [FIX] point_of_sale: close session with accountg rights
- Create a user with only Point Of Sale User rights
- As this user, open a POS session, create a POS order
- Validate and Close the session

An `AccessError` is raised because the user has no Accounting access
rights.

A POS user should be allowed to close a POS session, as it was the case
in 12.0.

opw-2251699

closes odoo/odoo#52710

X-original-commit: bc3aec38a092c7117dd8de8f6c975cdfad04b05d
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-06-10 09:18:43 +00:00
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
Laurent Smet caeb782841 [IMP] account,*: Improve bank statements/payments workflow
- Create journal entries as soon as bank/cash statement lines are created, temporary booked on a suspense account set on the journal.
- Simplify the management of "blue" lines in the reconciliation widget. A "blue" line is now a journal item using a temporary liquidity account (outstanding payment/receipt accounts, set on the journal).
- Adapt and simplify the bank reconciliation report.
- Remove the bank reconciliation threshold date. The reconciliation report will show the not already reconciled journal entries using a liquidity account and the not already reconciled journal entries using a temporary liquidity account. Without accounting, an account.payment will involve directly the liquidity account and then, will be considered as a statement line directly.
- Remove the post_at bank reconciliation feature. The "paid" state will be set on the invoices only if reconciled with a journal entry involving the journal's liquidity account.
    With invoicing, the payment will do that so the "in_payment" state should never be shown up.
    With accounting, only the statement lines have the power to move an invoice to the "paid" state.
- Fix various corner cases about the management of multi-currency in bank statement lines.
- Fix the conversion dates in multi-currency: Since the bank/cash is always used on the statement lines, it will use always the real "bank" date instead of the fictive payment one.
- Ensure the 'reconcile' method will raise an error if the involved moves are not posted.

related enterprise PR odoo/enterprise#7019

closes odoo/odoo#41301

--task: 2092096
Related: odoo/upgrade#1018
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-04-10 09:47:24 +00:00
Andrea Grazioso (agr-odoo) 0d8d36d468 [FIX] point_of_sale: keyerror due to already reconciled entries
1. Install PoS and Accounting
2. In the PoS setting activate the Invoicing option
3. Sell an item X with Invoice toggle to client Y and pay it
4. Sell the same item X with Invoice toggle to the same client Y with
quantity -1
5. Close the PoS session

Traceback wil occur when trying to Validate Closing & Post Entries
because in '_create_invoice_receivable_lines' already reconciled lines
are already filtered out so invoice_receivable_lines is empty

opw-2206625

closes odoo/odoo#49407

X-original-commit: e9f5e2b7fdd332ca0fc0f43c839118ef82d4eddb
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-10 12:15:15 +00:00
Loan (lse) b2e6784c69 [FIX] point_of_sale: wrong stock valuation entry
Before this commit:
When a PoS session is closed in anglosaxon accounting with real time stock valuation, the stock moves linked to PoS orders are used to create the stock valuation entry.
When an order is composed of only products of type 'service', there are no picking linked to the order, and so the entry is created with all stock moves having no picking_id.

After this commit:
To avoid this problem, we are checking that the PoS order has a picking before looking for stock moves.

OPW-2206625

closes odoo/odoo#49117

X-original-commit: 0386e1f099bf42a59a79febfa06906dd76bd62e2
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-04-07 09:43:25 +00:00
Nicolas Martinelli 5c97602c3f [FIX] point_of_sale: fixed tax price
- Create a tax:
  Fixed price: 0.355
  Included in price
- Assign the tax to product P
- Create a POS order with P and a price 0, pay by bank
- Create a POS order with P and a price 10, pay by bank
- Close the POS session.

The following entry is created:
                      D           C
Tax Received       0.01        0.00
Product Sales      0.00        9.65
Product Sales      0.36        0.00
Receivable        10.00        0.00

Several issues:
- the entry is posted and unbalanced: covered in #48484
- rounding of 0.355 was either 0.36 or 0.35: to fix one day... [1]
- the tax received of 0.36 for the POS order of 0 is booked on the debit
  rather than on credit, leading to a difference 0.01.

This happens because the taxes amounts for the POS order of 10 are
positive, while they should be negative for a sale as done in [2].

We set the amounts as negative as done for incoming invoices, and adapt
the tax line creation accordingly.

[1] The use case is weird: a fixed price of 0.355 while we only have 2
digits in the currency?
[2] https://github.com/odoo/odoo/blob/e415cffa2ffb3fe4b5f0e32bd96b3433387a95e3/addons/account/models/account_move.py#L461

opw-2168096

closes odoo/odoo#49104

X-original-commit: 5df8ed72d03de635f3c38ce59c1b3e9c9ce51ed2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-07 07:54:38 +00:00
Andrea Grazioso (agr-odoo) 222aa42512 [FIX] point_of_sale: do not reconcile 0 sum lines
- Have a clean V13 db with point_of_sale and account_accountant
- General Settings => Accounting => Check "Anglo-Saxon Accounting"
(debug mode)
- Choose or create a storable product P with category C
- Go to category C and set 'inventory valuation' to 'automated'
- Open a new POS session PS
- Sell product P with qty 1
- Pay
- New order
- Sell product P with qty -1 (refund)
- Pay
- Close session PS
- Validate session PS

Error "You are trying to reconcile some entries that are already
reconciled." will popup because the 0 sum AML is already marked as
reconciled. This can be fixed by avoiding asking reconciliation when the
amount_residual is 0.

opw-2177881

closes odoo/odoo#48799

X-original-commit: 2c5ef4ed7ea98f890f95f8892c8a0df64b88db98
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-04-01 20:55:36 +00:00
Joseph Caburnay 0de552c7c5 [FIX] point_of_sale: closing session with zero-valued invoice
The problem is described in https://github.com/odoo/odoo/issues/48550.
This is caused by reconciled receivable line in the invoice being
reconciled with another reconciled receivable line in pos_session's
move_id. The lines are already reconciled because their balance is zero.
So to avoid trying to reconcile those reconciled lines, we do not
include them in the list of lines to be reconciled.

closes odoo/odoo#48587

X-original-commit: f24677098bec9b96108a901dde08bf75dc7d4c5f
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-03-30 10:03:31 +00:00
Victor Feyens 25cf56e49b [FIX] point_of_sale: ensure properties are read with the correct company. 2020-02-27 12:19:24 +00:00
Ankita Raval 933b21e2c5 [IMP] account,*: rename tag_ids to tax_ids in account.move
closes odoo/odoo#44835

Note: Many2many table name and columns name is not changed so no change in report's query
Task-id: 2028813
Related: odoo/enterprise#8261
Related: odoo/upgrade#745
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-02-19 09:09:20 +00:00
Nicolas Martinelli a232f56312 [FIX] point_of_sale: refund in multi-currency
- Create a POS in a currency different from the company currency
- Open a POS session
- Do a refund (negative quantity)
- Close the session

An incorrect journal entry is being created, blocking the process.

This is because the sign of `amount_currency` is changed, while it
shouldn't.

opw-2191664

closes odoo/odoo#45619

X-original-commit: 1ac17f5d05dc4dd82db4a622229ba1ca2a7f31aa
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-18 11:58:36 +00:00
Joseph Caburnay dc980e9448 [FIX] point_of_sale: anglo saxon and tax lines in different currency
The problem occurs when the pos session has currency that is different
from the company's currency. Additionally, product that is tracked in
accounting is also sold in this session.

This situation results to anglo saxon move lines that are incorrectly
converted.

The current implementation considers the value from the stock valuation
layer to be in the session's currency. However, that is not the real
case because values in the valuation layer are always in the company
currency.

With regards to tax line, the tax_base_amount is not converted to the
company's currency. It's value should always be in company's currency.

This commit fixes the behavior of pos in generating anglo saxon lines
and setting the correct tax_base_amount in the pos session's accounting
entry.

X-original-commit: 2bdbea3bbf87a921ed3b343f5146a519f10e0add
2020-02-18 11:58:36 +00:00
jev-odoo 08f6dc2495 [FIX] point_of_sale: factorization of _create_account_move
This factorization is needed for support purpose.
I.E.: This will allow to post an account move to balance
unbalanced journal entries.

Basically, it divides the function into sections
that were already present in comments.

closes odoo/odoo#45231

X-original-commit: 26e012015a6803af6c2a5480984f1c02e0244e83
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-12 16:12:38 +00:00
Sylvain LE GAL 1e1e511cea [FIX] call _get_product_accounts() everywhere
closes odoo/odoo#41632

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2020-01-23 14:29:45 +00:00
Andrea Grazioso (agr-odoo) 0ddfbab90f [FIX] point_of_sale: skip 0% tax declaration
Install point_of_sale and a localization (i.e. l10n_be) with a tax
configured with 0% and no account.
Assign the tax to a product available on POS. Open POS session, sell
such product, close session and validate. Error message will popup,
blocking the action because the tax used for the product has no
associated account for posting the entry.

This should not be the case because the tax is 0% so it should not be
posted. Skipping taxes based on the amount to avoid the issue.

opw-2155173

closes odoo/odoo#41821

X-original-commit: c7936d2884c10865bfc39a43d30aef6926f29079
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-12-12 13:38:49 +00:00
mightyjol (jhk) 346048be50 [FIX]point_of_sale:clients from pos sessions are now considered customers
Steps to reproduce:
-install the POS module
-install the Contacts module
-create or use an existing partner as a customer during the pos session
-go to contacts and activate the "customer" filter
-> partners used during the pos session are not showing in the list

The problem was that the 'customer_rank' property
https://github.com/odoo/odoo/blob/d8d7635d6cf2af60791f25201a7bd1c2d5ec238b/addons/account/models/partner.py#L430
was not updated properly after a pos account move was done

Previous behavior
After ending a POS session, partners that are created and/or used
during the session are not showing on the Contacts views when the
'customer' filter is active

Current behavior:
The customer_rank of the partners is increased by one for every sale
during the pos session
Partners created or linked during a POS session are now considered
customers and appear in the contact view when the "customer"
filter is active

opw-2148894

closes odoo/odoo#41792

X-original-commit: 22874376594f94232e0c4ad5a4db3ee76f24b39a
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-12-12 11:31:32 +00:00
Robin Heinz 42425996e3 [IMP] point_of_sale: Use the cash rounding in the pos
Because of the law of the 1st december 2019, we can't pay with 1 or 2 cents anymore.
We have to round the total price to the 0.05 unit.
If the customer pay without rounding values, it triggers an error.
Before the order is finalized, we add a line with a product rounding to round the total amount.

Task-id: 2035010
X-original-commit: 58477e5503a18cc98fe686f8857233063eb26f4c
2019-12-03 14:20:31 +00:00
Robin Heinz daf6db970d [IMP] point_of_sale: cash closing difference visible
When a pos session is closed, the difference and transactions of cash
control are not good anymore, because it is based on the statement
linked to the cash payment method, and it is modified during the
validation of the session to create a balanced account move.

So we are now storing the values in fields, to keep history of the
closing control

closes odoo/odoo#35286

Task-id: 2032173
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-11-25 11:00:04 +00:00
Victor Feyens 9215e73fa2 [IMP] * : replace with_context(force_company=c) by with_company(c) 2019-11-18 12:25:05 +00:00
Pierre Masereel 2f2bde5d9f [IMP] point_of_sale: create picking after closing session
When you have a lot of pos order to synchronize with Odoo, it may take a
lot of time because it has to create a picking for each order. So we've
added an option in the settings that will create the picking at the end
of the session.

So the new option by default is creating the picking at session closure,
and if you need a real time stock you can enable the creation of picking
for each order.

closes odoo/odoo#39584

Task-id: 2082064
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-11-07 09:34:01 +00:00
Joseph Caburnay fb85375388 [FIX] point_of_sale: uninvoiced orders' state not set to 'done'
Prior to this commit: b234e97f87,
uninvoiced orders' state is set to 'done' when the session is validated.
However, this was not taken into consideration in the said commit such
that even if the session is already validated, the uninvoiced orders'
state remains 'paid'.

Setting the orders state to 'done' is the correct behavior and is
implemented in this commit.

closes odoo/odoo#39735

X-original-commit: bb490301c22c84c86d2b1c2d27ecb96a4ff19ac5
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-11-04 12:07:13 +00:00
Nicolas Martinelli 855b29b6d0 [FIX] point_of_sale: cash balance
- Go to POS application
- Click on the 3 dots of the session to open configuration
- Remove the "Cash" payment method and just keep "Bank"
- Open the session, proceed to a sell and close it.
- Try to open the session either clicking on "Close" on the kanban card

`CacheMiss` error.

opw-2116470

closes odoo/odoo#39570

X-original-commit: 62cb92644de3cfa6e7864583d1efcaf5821f05e4
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-10-30 12:06:01 +00:00
Raphael Collet c8dca514e6 [FIX] fields: compute_sudo defaults to True for stored fields only
The default `compute_sudo=True` makes sense for recomputing stored
fields that are indirectly related to a business operation.  This
ensures that the recomputation of the field does not break an operation
that is not aware of the fields to recompute.

However, computing non-stored fields in superuser mode is usually not
necessary.  It even leads to unexpected values: counting a partner's
sales orders does not give the same result in superuser mode as in
normal mode.  That is why non-stored fields are not computed in
superuser mode by default.

[FIX] account, delivery, event, hr_recruitment, point_of_sale, stock:
adapt the model definition to make all fields with the same compute
method have the same value for `compute_sudo`.

[FIX] sale: split the computation of `invoice_ids`, `invoice_count`
(non-stored) and `invoice_status` (stored), as no code is actually
shared.

closes odoo/odoo#39195

X-original-commit: 843fd38a97f02b49dc09d7f55919072d272fd80e
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-10-22 14:55:51 +00:00
Victor Feyens 1ef89f0928 [FIX] point_of_sale: use sudo instead of with_user(SUPERUSER_ID).
Since https://github.com/odoo/odoo/pull/34297, sudo() allows to keep
current user information when creating/modifying records.

There is no need anymore to use with_user(SUPERUSER_ID) to have sudo rights.

This commit ensures the user information is kept when creating pos sessions,
instead of having OdooBot as create_user.

closes odoo/odoo#38441

X-original-commit: aff1dc1ea68c345fb2632f9666dc298f685b8748
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2019-10-10 19:00:54 +00:00
Naglis Jonaitis 6404fc80b2 [IMP] point_of_sale, sale: remove digits attribute from monetary fields
Follow-up of #35336

closes odoo/odoo#36047

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-10-03 14:51:01 +00:00
Pierre Masereel 934dd57b81 [FIX] point_of_sale: close session without ordered
We cannot close a session without POS order as we are giving explicitly
a name to the account_move, it is not possible to delete it at the end
when it is empty.

So we don't name it anymore, and it takes its name from the journal
sequence when it is posted, which actually do exactly the same as
before, except that it avoid to have gaps in the sequence and allow
deletion of the move if it's not named.

closes odoo/odoo#37787

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-10-02 13:13:03 +00:00
Gert Pellin 71e9c4dc7a [FIX] point_of_sale: close session in multi company
Close a rescue PoS Session from another company triggers this error:
"Please define income account for this product: "Office Chair" (id:5).

property_account_income_id on product is company dependent but no
company was forced before this fix.

closes odoo/odoo#36280

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-09-13 10:05:44 +00:00
Gert Pellin 2d36eb8baa [FIX] point_of_sale: open payment form from list
Impossible to open a pos.payment form through the session. Go to PoS >
 Sessions > open a session > Payments > you have the list view, and the
 form view doesn't open if you click on a line. Demo :
 https://drive.google.com/file/d/1IUFSsUGRhnbHAniSh6pldfSlPqRh8_JE/view
2019-09-13 10:05:44 +00:00