Commit Graph

459 Commits

Author SHA1 Message Date
Joren Van Onder 35e9fa5c41 [FIX] point_of_sale: handle POS clients with a closed session
People sometimes have an open POS client (/pos/web) which is associated
to a closed POS session. This causes multiple issues. The most important
problem occurs when a user closes the session and opens a new session
without refreshing the POS client. When doing this new POS orders will
become part of the old, already closed session and no new accounting
entries will be generated.

In order to fix this we make sure to check that the session that's
associated with the order that we get from the client is still open. If
it isn't we'll try to find a new, compatible session and add the order
there. If we cannot find a compatible session we'll create a new one
based on the old, closed one. When creating this new session we bypass
the opening_control phase which normally takes care of opening cash
control.

opw-652356
2015-10-28 14:04:25 +01:00
Goffin Simon 77c8da7d2f [FIX] point_of_sale: tax_amount sign
The sign of the tax_amount in an "account.move.line" can be negative.
Introduced by cb86fef

opw:648231
2015-09-10 09:10:50 +02:00
Nicolas Lempereur a69af9c908 [FIX] addons: propagate context when get sequence
With 3e82c94d we use the timezone in the context to format date
sequences when formatting an ir.sequence.

This commit adds the other missing context when getting a sequence, so
these sequences are also dependant on the timezone.

closes #8351
opw-646487
2015-09-03 13:58:01 +02:00
Nicolas Lempereur 3e82c94d69 [FIX] point_of_sale,base: use context timezone for sequence
Previously when replacing time related sequence in a prefix or suffix of
a sequence, the timezone used for the time values would always be the
server's timezone.

With this fix, the context timezone is used if available (UTC is used
otherwise).

closes #8159
opw-646487
2015-08-25 14:08:17 +02:00
Goffin Simon 8a2ff461db [FIX] point of sale: create account move line
The method "_create_account_move_line" must take into account the rounding
method when computing the taxes for each line.

closes #7683
opw:645516
2015-07-24 15:05:26 +02:00
Martin Trigaux 0fb1b6a856 [FIX] point_of_sale: method expects id
The method add_payment expects to recieve the id of a journal, not a browse
record. Introduced at 4b548d9
Courtesy of bluesoft83
2015-07-22 08:54:21 +02:00
Alexis de Lattre 4b548d98d1 [FIX] point_of_sale: payment method selection
When giving back change, prioritize the same cache method as the one that was
use for the transaction.
This prevents cases where cash input is registered in journal B and change in
journal A.
Fixes #6975, closes #6976
2015-07-16 15:47:56 +02:00
Jos De Graeve baa51efdc9 [FIX] point_of_sale: do not create empty picking for order with only service products
When confirming a pos order with only "service" products, an emtpy pos order is
created which stays in "draft" state forever.

Closes #7460
2015-07-06 11:33:19 +02:00
Mario Arias Badilla b02afebd1e [FIX] point_of_sale: payment date take into account user tz
When you apply payment in POS,
it takes current time for "date" field
on bank statement line,
but should use context_timestamp to take care
of user timezone adjustments.

Example:
If user is in time zone GMT-6:00,
then after 6:00pm all bank statement lines will be recorded
with date of next day, and all closing reports and related
accounting will be wrong!

Fixes #2199
Closes #2200
2015-07-02 01:56:25 +02:00
Goffin Simon a3fbc2da86 [FIX] point of sale: rounding globally
The amount total computed for pos order must be the sum of the rounded tax amount
and the rounded untax amount. Inspired from _amount_total in "sale.order".

opw:643254
2015-06-25 11:52:05 +02:00
Jos De Graeve 3abd451aca [FIX]point of sale: passing analytic account
In the method action_invoice, the call to the method "_prepare_analytic_account" in dict "inv_line"
had no effect because the value of account_analytic_id was being cleared by the product_id_change statement.
So in the end the invoice line was created without any account attached
Now it checks for an existing value, and if it is not already filled in,
the value from  _prepare_analytic_account is taken.
2015-06-24 13:55:32 +02:00
Goffin Simon 9c30ba7143 [FIX] point_of_sale: sum of pos.order.line
amount_line_tax must be used to compute the _amount_all. In this way,
the taxes are computed by "compute_all" which takes into account how
to round(globally or per line). Inspired from "sale.order" behaviour.

Fixes #6765
opw:640211
2015-06-16 16:04:36 +02:00
Nicolas Martinelli 3274f8c94c [FIX] point_of_sale: remove deprecated field account_receivable
property_account_receivable should be configured by default.

opw-639766
2015-05-29 13:39:29 +02:00
Goffin Simon c5a613840f [FIX] point of sale: function is_paid:
When rounding globally, the function compute_all in charge to compute the taxes for
each line uses a very high currency rounding to avoid rounding per line.
The round must be done on the sum of each total amount line with taxes. To validate a payment with the pos,
the function is_paid verified that this sum is the same that the amount just paid.
Inspired from "sale.order.line", the precision of 'price_unit' and 'price_subtotal' in "pos.order.line"
must be taken from 'Product Price' to avoid rounding per line.

ps: we could not use the function get_all_prices to round globally because it used on every line.

Fixes #6681
Closes #6682
opw:639686
2015-05-19 09:41:51 +02:00
Nicolas Martinelli 5a8fcd5c01 [FIX] point_of_sale: use session start date instead of system date when closing session
When the session is closed, the date used is the date of the session start instead of the
system date. This is necessary when the server is not on the same timezone than the user,

opw: 631497
2015-04-14 11:26:15 +02:00
Goffin Simon cb86fefc3a [FIX] point_of_sale: Bad tax code
The tax code used for a return product must be the refund tax code.
Tax/Base Amount amount must be positive.

opw:631303
2015-04-13 17:09:58 +02:00
JosDeGraeve 6f35b0b3fa [FIX] point_of_sale: set analytic account on pos invoice
The analytic account is set on entry generated from pos.order but it was not for
the invoices generated from the pos orders.
2015-04-09 16:55:37 +02:00
han-odoo cec7a02fdd [FIX] POS: invoices taxes according to fiscal position
Fix the issue of taxes not being mapped
according to fiscal postion

opw-615167
2015-03-26 17:08:33 +01:00
Goffin Simon d117bad18c [FIX] point_of_sale: invalid tax amount on grouped entries
If "Group Journal Items" option is checked, the generated accounting entries may get an invalid tax amout.
This will happen when several entries for the same product do not use the same tax amout (e.g. discount).
Avoid grouping products with different taxes under the same line by creating one line per tax_code_id.

opw 626695
2015-03-17 10:16:56 +01:00
Goffin Simon 3ff4cdea95 [FIX] pos: Bad float comparison to check amount_return in _process_order.
Float comparison should always be done using float_compare, or float_is_zero when compared to 0.0.

opw: 627248
Closes #4118
2015-02-23 13:32:05 +01:00
David Monjoie 88349d0fab [FIX] point_of_sale: added date_done field value on generated stock.picking
Fix for Issue 627561 (5169 on Github)
2015-02-11 10:23:02 +01:00
Martin Trigaux 52a39e2dd2 [IMP] point_of_sale: check also inactived products
use search_count instead of search
2015-01-19 15:26:42 +01:00
Martin Trigaux c637a0ff1c [IMP] point_of_sale: prevent deleting products that may be sold
When a pos.session is launched, all the products are loaded. If the product
was deleted in the backend, it was still possible to sell it in the pos.
2015-01-19 15:11:59 +01:00
Martin Trigaux edf3beee67 [IMP] point_of_sale: extract creation of order in separate method
To allow overwrite in submodules and more readable code.
2015-01-19 15:11:51 +01:00
Denis Ledoux 87dd06c941 [MERGE] forward port of branch saas-3 up to 8c150c6 2015-01-15 14:43:32 +01:00
Denis Ledoux a692c6e934 [MERGE] forward port of branch 7.0 up to f406847 2015-01-15 11:49:28 +01:00
Christophe Simonis ba5978afef [FIX] point_of_sale: correct pos.category name_get() to show whole hierarchy 2015-01-14 16:06:43 +01:00
Nicolas Seinlet 35a061eb0d [IMP] point_of_sale: faster loading of pos session
name_get of pos.category should use a browse instead of a read.
For a company having thousands of products and a few categories, using a browse
will greatly improve the load time as it is cached.
2015-01-14 13:45:20 +01:00
Denis Ledoux e261c44a10 [FIX] point_of_sale: ACLs for pos users
POS users should not be able to create nor modify payment methods (account.journal)
POS users should not be able to create nor modify point of sales (pos.config)

At first opened session, if no payment methods was set, this is possible that the pos user should temporary have accesses granted to mark a payment method as pos payment method. This is done by the openerp.SUPERUSER_ID added by this rev.

opw-625489
2015-01-13 18:15:30 +01:00
Alexis de Lattre a9907aac8a [FIX] point_of_sale: do not group move lines with different analytic account
When generating account.move.line from pos.order, orders with different analytic
account should not be groupped in generated lines (possible if inherit
_prepare_analytic_account).
Add the analytic_account_id in the key to avoid this grouping.
Fixes #4602
2015-01-09 12:14:45 +01:00
Martin Trigaux 7a13e9d744 [FIX] point_of_sale: account selection for payments
Registered payment uses the partner receivable account. As this field is
a property field, it will select different accounts based on the user that
registers the payment (in multicompany).
Should use the company of selected journal instead of the one of the user.
2014-12-16 10:53:30 +01:00
Frederic van der Essen d1fb79ad14 [FIX] point_of_sale: some pos order fields were missing the proper decimal precision 2014-11-11 18:00:24 +01:00
Alexis de Lattre 6dcb8232eb point_of_sale: Add _prepare_analytic_account method to easily set analytic account from custom module 2014-10-27 23:52:43 +01:00
Martin Trigaux a6343387d7 [IMP] point_of_sale: add constraint on company
Using a payment method belonging to another company will raise errors when closing the session.
To avoid being stuck at session closing, forbid to create a POS using a journal of another company.
2014-10-17 17:21:30 +02:00
Frederic van der Essen 5377a9e2d6 [IMP] point_of_sale: partner edition ! -> create partners, edit partners, assign them barcodes, take pictures, etc. 2014-09-17 16:57:34 +02:00
Olivier Dony e5bff82aff [MERGE] Forward-port saas-5 up to f9bcd67 2014-09-17 16:39:06 +02:00
Olivier Dony c926b54a49 [MERGE] Forward-port saas-3 up to 09ab2d4 2014-09-17 15:16:30 +02:00
Denis Ledoux 60a82133cc [MERGE] forward port of branch 7.0 up to f5f7609 2014-09-17 13:39:13 +02:00
Denis Ledoux ce84d6107f [FIX] point_of_sale: set journal as pos payment method on setting journal in the payment methods of a pos config when none is set. 2014-09-16 17:57:03 +02:00
Frederic van der Essen 2a10394880 [FIX] point_of_sale: the self_checkout related fields are obsolete and should be removed, but we are too late in the release schedule to do so. Marking them as FIXME, to be removed for next major version 2014-09-08 18:06:51 +02:00
Christophe Simonis 8046b7367d [MERGE] forward port of branch saas-5 up to 7e117b1 2014-08-28 16:51:11 +02:00
Christophe Simonis 7e117b18a0 [MERGE] forward port of branch saas-3 up to ada9724 2014-08-28 16:21:27 +02:00
Christophe Simonis ada9724655 [MERGE] forward port of branch 7.0 up to 3509e15 2014-08-28 16:12:55 +02:00
Martin Trigaux 69cd13a084 [FIX] point_of_sale: incorrect sequences for orders
A new ir.sequence is generated at pos.config creation for the orders. However it was not used as the type was not set. The fallback was done on the general sequence.
In addition to the sequences being shared, it was not possible to create a pos.order in multicompany (no sequence found for user company, name was null).
Same issue for the pos.order.line.
This patch generates correctly pos.order and pos.order.line sequences at pos.config creation.

Instead of using the pos.config sequence to generate session number (not what this field was intended to), use the existing sequence for pos.session.
Remove company_id value on default pos.session sequence to make sure it's shared between companies and correctly set the prefix.
2014-08-26 16:33:58 +02:00
Martin Trigaux f6dceb2ef6 [IMP] point_of_sale: prevent multicompany configuration issues
If the pos.config is not properly configured for multicompany (e.g. using location belonging to another company), launching a session with this config may fail (access rights).
This prevents to configure an incorrect point of sale in the first place.
2014-08-26 16:15:22 +02:00
Martin Trigaux 73546f70ca [FIX] point_of_sale: generate bank statement with commerical partner
When a pos session is closed & confirmed, the account.move were generated with the commercial partner except for the bank statement which prevented automatic reconciliation.
This patch uses the commercial partner also for bank statement.
Fixes #1558, #1764
2014-08-22 15:29:23 +02:00
Fabien Pinckaers d14297ac53 [FIX] better responsibilities on objects POS 2014-08-21 10:38:21 +02:00
Frederic van der Essen 0829afadd2 [FIX] point_of_sale: continuation of the session closing fix 2014-08-20 23:08:20 +02:00
Frederic van der Essen 62a8e5b457 [FIX] point_of_sale: partial fix for unclosable sessions 2014-08-20 22:24:21 +02:00
Christophe Simonis 1d85c667f7 [FIX] point_of_sale: correct SyntaxError 2014-08-20 20:24:09 +02:00