100 Commits
Author SHA1 Message Date
Pedram (pebr) 76c0b98119 [FIX] point_of_sale: prevent Order Duplication from Backend
Prior to this commit, it was possible to duplicate a PoS order from
the backend.

opw-3839287

closes odoo/odoo#163018

Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
2024-04-26 17:17:56 +00:00
Pedram (pebr) 5f870ed29b [FIX] l10n_fr_pos_cert: log hash string for better error investigation
This commit add the logging of hash string data. By printing the string
to hash, it becomes easier to investigate issues.

opw-3839287

Part-of: odoo/odoo#163018
2024-04-26 17:17:56 +00:00
Pedram (pebr) cc6b224bb0 [FIX] point_of_sale: preserve a saved order state during sync failures
If an order was validated in PoS but encountered a sync error, the
order would revert to a draft state and no receipt would be printed.
However, if an order was validated in PoS without internet, the receipt
could still be printed. When the internet connection was restored, the
system would attempt to validate the unsynced order. If a server error
occurred during this process, the system would try to revert the order
to a draft state and fail. This behavior is not ideal as an order with
a printed receipt should not be modified or changed. This commit
ensures that in the event of a sync failure, the saved orders do not
revert to a draft state.

opw-3858994

closes odoo/odoo#161250

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-04-25 13:22:54 +00:00
Pedram (pebr) a2a59d1e69 [FIX] website_event_sale: ensure sale_last_order_id is set in session
This commit fixes an issue where the `sale_last_order_id` was not being
set in the session when the extra info step was added to the checkout
process. This caused an error during the validation of event payment in
`shop_payment_validate`.

Steps to reproduce the issue:
1. Install `website_event_sale` and set up a payment provider.
2. Add the extra info step to the checkout in the website.
3. Register for a paid event from the website.
4. Proceed to pay the order, which would previously result in an error.

opw-3864873

closes odoo/odoo#162657

Signed-off-by: Jérémy Hennecart (jeh) <jeh@odoo.com>
2024-04-25 11:21:50 +00:00
Pedram (pebr) dcdef39697 [FIX] point_of_sale: Ensure order exists before reading state in refund
Prior to this commit, there were scenarios where sync orders did not
contain an order, leading to a failure when reading its state. This
commit introduces a check to ensure the order exists in sync before its
state is read, thereby preventing this error.

opw-3856451

closes odoo/odoo#162943

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-04-23 15:32:54 +00:00
Pedram (pebr) 6b48e2e3bf [FIX] point_of_sale: prevent PoS failure due to invalid cached orders
Prior to this commit, the presence of an invalid order in the browser
cache could prevent the PoS from loading. This issue typically arises
after a database upgrade, where changes in fields can render unpaid
orders in the cache unloadable. This commit resolves this issue by
discarding any problematic unpaid orders that can no longer be loaded.

opw-3874858

closes odoo/odoo#162408

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2024-04-19 14:40:08 +00:00
Pedram (pebr) 9e8c451f69 [FIX] point_of_sale: prevent duplicate display of multi attributes
Prior to this commit, if a product had multiple attributes, each
attribute would be displayed multiple times in the order line. This
commit resolves this issue by ensuring that each attribute line is
displayed only once.

opw-3849701

closes odoo/odoo#162258

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2024-04-18 12:55:04 +00:00
Pedram (pebr) 02ff4c998a [FIX] point_of_sale: prevent splited order display
Prior to this commit, splitting an order would create a new order,
causing it to appear again on the preparation display. This could
lead to the kitchen preparing the same order twice. The sequence of
events was as follows:

1. The order is placed.
2. The kitchen receives and prepares the order.
3. The waiter delivers the order to the table.
4. The client receives the bill and requests a split.

At the point of splitting, a new order is created. This duplicate order
should not be sent to the kitchen as it represents a meal that has
already been prepared and consumed. This commit resolves this issue by
preventing display of duplicate orders to the kitchen during order
splitting.

Enterprise PR: https://github.com/odoo/enterprise/pull/60537

opw-3809693

closes odoo/odoo#161498

Related: odoo/enterprise#60537
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-04-12 08:16:11 +00:00
Pedram (pebr) f948473914 [FIX] point_of_sale: Refine partner search to match start of line
Before this commit, when adding two columns to the address, the search
string would become formatted as such:
"47:abigail peterson|address Belgium address0: 12, |abigail..."

Searching for "abigail" would incorrectly match with "0: 12, |abigail",
leading to the addition of the partner with ID 0 and causing an error.

With this commit, we have refined the search to match only at the
beginning of a line. This prevents incorrect matches and the subsequent
errors, improving the reliability of the partner search.

opw-3847934

closes odoo/odoo#160475

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-04-05 14:01:10 +00:00
Pedram (pebr) c6b1d287e7 [FIX] point_of_sale: ensure correct display of custom attributes
Before this commit, the custom attribute names were not correctly
displayed when added to an order.

opw-3795843

closes odoo/odoo#158805

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-28 14:16:49 +00:00
Pedram (pebr) 91b31d105d [FIX] pos_loyalty: Check gift card prefix from nomenclature
The barcode nomenclature allows to define custom prefix for gift cards.
e.g. the default nomenclature in demo data allows both 043 or 044 as
prefix for rule of type coupon.

Therefore the hardcoded string with 044 doesn't allow to sell a gift
card whose barcode does not start with this.

Instead of hardcoding the value, fetch it from the configuration and
the nomenclature that is defined in the settings.

OPW-3499787

closes odoo/odoo#159349

Signed-off-by: David Monnom (moda) <moda@odoo.com>
2024-03-27 14:09:50 +00:00
Pedram (pebr) eca2ec1328 [FIX] point_of_sale: prevent unbalanced error for invoicing cash orders
Before this commit, attempting to invoice an order paid by cash in a
new session, with cash rounding enabled only for cash payments in the
PoS config, would result in an unbalanced entries error.

opw-3813932

closes odoo/odoo#158907

X-original-commit: 3a61e143af62f1edeec299a39ab133138ec0560c
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-03-27 09:12:48 +00:00
Pedram (pebr) adc04e2bb2 [FIX] point_of_sale: prevent rounding modification with an open session
Prior to this commit, the rounding setting could be modified while
a session was open. This could potentially cause accounting
discrepancies and lead to unbalanced account moves.

opw-3677480

closes odoo/odoo#158625

X-original-commit: 021302a270028373ab519ea1d5409ffb73ee8424
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-03-25 17:50:05 +00:00
Pedram (pebr) 8865312f7c [FIX] pos_loyalty: Accurate computation of free product with tag
Prior to this commit, if a "Buy X get Y" promotion was in place, with
a free product reward associated with a specific tag, the computation
of the free product reward could be incorrect in the Point of Sale
when combined with products carrying the tag.

opw-3753994

closes odoo/odoo#158618

X-original-commit: 5f3c8017c5cf255e3b3fa53631a243d2f61c9f60
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-03-25 17:50:04 +00:00
Pedram (pebr) b4ae7c8425 [FIX] point_of_sale: enable report generation with multi bank payments
Following commit https://github.com/odoo/odoo/commit/d9190e34543c4a1151656859acb41556bcb3a364, generating a sale report became
impossible if a session had more than one account payment.
This was due to a ValueError: Expected singleton.

opw-3799171

closes odoo/odoo#157691

X-original-commit: eade8f182b4e4676feff61e3ec24e38ae6641985
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-03-22 16:49:48 +00:00
Pedram (pebr) 74b6f0745d [FIX] pos_loyalty: enable free product for Next Order Coupon program
Before this commit, the free product reward feature in a Next Order
Coupon program was not functioning as expected. This commit fixes this
issue, ensuring that free product rewards are correctly applied in Next
Order Coupon programs.

opw-3703485

closes odoo/odoo#156008

X-original-commit: 8da5ea1a7cb26bffe7045b1dc325c24b6f9a2af7
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-03-11 17:53:36 +00:00
Pedram (pebr) f91f5ed51f [FIX] point_of_sale: ensure QR code is printed on receipt reprints
Before this commit, if a receipt was reprinted, the QR code was not
included. This could lead to issues with receipt validation and
scanning.

opw-3763169

closes odoo/odoo#156948

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-08 11:17:44 +00:00
Pedram (pebr) e7d270063f [FIX] pos_self_order: prevent multi-company access error
Before this commit, if the POS user didn't have access to the first
company, an access error would be raised when accessing the self-order
page. The steps to reproduce this issue are as follows:

1. Add another company and set up POS self-order.
2. Remove the other company from the Marc user.
3. Open the POS in the new company.
4. Try to access the mobile menu.
This would result in an access error.

The issue was that the first company existed in the
`allowed_company_ids` in the context. To solve this, we need to
correctly set the `allowed_company_ids` in the context.

opw-3744500

closes odoo/odoo#156357

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-08 09:42:52 +00:00
Pedram (pebr) a8be301b29 [FIX] point_of_sale: improve product search in large databases
Before this commit, searching for a product in the product screen was
problematic when dealing with large databases. The search function was
triggered too frequently, leading to performance issues.

With this commit, I have increased the debounce time for the product
search. This reduces the frequency of search operations when user is
typing.

opw-3788796

closes odoo/odoo#156806

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2024-03-07 15:12:19 +00:00
Pedram (pebr) 2194505cf9 [FIX] point_of_sale: keep consistent tracking number for paid orders
Before this commit, when loading paid orders, the tracking number would
differ from the backend. This discrepancy was due to the fact that the
`pos_session_id` was being changed to the current session.

opw-3788982

closes odoo/odoo#156733

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2024-03-07 15:12:17 +00:00
Pedram (pebr) f6ee5e4ad2 [FIX] point_of_sale: correctly handle RPCError
Prior to this commit, in the event of an RPCError, such as UserError or
ValidationError, it would display a generic 'Odoo Server Error' error.
This error lacked useful information for diagnosing and addressing the
issue.

opw-3776047

closes odoo/odoo#156697

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-06 14:30:47 +00:00
Pedram (pebr) ca18e93958 [FIX] point_of_sale: correct computation of product total with discount
Before this commit, if a product had a discount applied in two
different orders, it could lead to incorrect calculations in the report
For instance, if a product priced at 14.45 had a 30% discount applied,
the discounted value would be 10.115, which rounds to 10.12. However,
if there were two orders with the same discount, the report calculation
would count the quantity of a product with the same discount and
calculate the product total amount in one place. This would result in a
discounted value of 10.115 * 2 = 20.23, while in the two different
orders we had two 10.12 which sums to 20.24.

With this commit, the calculation method has been changed. Now, the
product amount total for each line is calculated first, and then the
sum of these amounts is used to calculate the total for all of the
orders. This change ensures accurate computation of the product total
sum when discounts are applied across multiple orders.

opw-3721376

closes odoo/odoo#156160

X-original-commit: bb71f77e117a8a07c1e161f583d136cd5c16a078
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-03-04 13:26:31 +00:00
Pedram (pebr) e8c46f3e6c [FIX] point_of_sale: hide receipt in the render container after print
Before this commit, the POS receipt was added to the bottom of the
page after printing. In some browsers, this caused overflow and made
the POS interface scrollable.

With this commit, we fix this issue by changing the position of the
receipt container to 'fixed'. This prevents the receipt from affecting
the layout of the page after printing, thus avoiding the overflow issue
and keeping the POS interface non-scrollable.

opw-3775808

closes odoo/odoo#156025

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-01 10:29:42 +00:00
Pedram (pebr) ce1fef9113 [FIX] point_of_sale: ensure QR code loads in auto-printed receipts
Prior to this commit, enabling auto receipt printing resulted in the QR
code not being printed on the receipt. This was due to the QR image
being fetched post printing. This commit addresses the issue by first
loading the QR code image, then sending it to the printer, ensuring its
presence on the printed receipt.

opw-3763169

closes odoo/odoo#155354

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-03-01 10:29:38 +00:00
Pedram (pebr) 43cb6001d7 [FIX] point_of_sale: prevent double calculation of base amount
Before this commit, if a tax had multiple distribution lines, the
base amount was calculated for each line. This resulted in the base
amount being multiplied by the number of distribution lines. This issue
has been resolved by ensuring the base amount is counted only once for
each tax and line.

opw-3696800

closes odoo/odoo#155690

X-original-commit: f8842269cee1df62ff4378473dc59da6fca7eec5
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-02-28 19:49:11 +00:00
Pedram (pebr) e966722518 [FIX] point_of_sale: prevent order duplication due to quantity rounding
Before this commit, it was possible to capture an order twice due to
the rounding difference in quantity, especially when users use a scale.

With this commit, it uses a more relaxed condition and remove the
quantity from the orderline comparison. Given that the system checks
the payments and with the same product and price units, it's unlikely
that two orders will have the same payment amount.

opw-3735436

closes odoo/odoo#155612

X-original-commit: 9f1f8fcd272005eb2cba4bf6feee0ea0b2f2609f
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-02-28 19:49:08 +00:00
Pedram (pebr) 2e62a211a3 [FIX] pos_loyalty: ensure partner name is printed on reprinted receipts
Before this commit, due to a recent change, the customer name was not
being printed on reprinted receipts. This was inconsistent with user
expectations, as they expected to see the customer name on the receipt,
regardless of whether a loyalty program was in place or not.

With this commit, we ensure that the customer name is always printed on
reprinted receipts, aligning the system behavior with user expectations.

opw-3760165

closes odoo/odoo#155543

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-02-27 16:16:09 +00:00
Pedram (pebr) 37d414c238 [FIX] point_of_sale: retain element in whenMounted
Prior to this commit, the receipt element was cloned and appended to
the render-container for web printing, then deleted after print
callback. This approach failed on Android, leading to an empty page,
as the cloned element was removed before printing. This commit resolves
the issue by retaining the cloned element until the next clone addition
to the container, at which point existing elements are removed.

opw-3755682

closes odoo/odoo#154777

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-02-26 11:41:55 +00:00
Pedram (pebr) 494231e796 [FIX] point_of_sale: disallow refunds from multiple invoiced orders
Before this commit, users could create a refund order from multiple
invoiced orders. However, such an order could not be invoiced as it was
associated with more than one account_move, leading to a failure. This
commit fixes this issue by preventing users from creating a refund
order from multiple invoiced orders.

opw-3710539

closes odoo/odoo#154369

X-original-commit: 177b0378d046ac769f2349c6444d14ca280e3c77
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-02-19 15:02:21 +00:00
Pedram (pebr) 9de0092f50 [FIX] pos_loyalty: ensure free product with tags is added to order
This commit fixes an issue where free products associated with a tag
were not being added to the order. The logic for adding free products
based on tags has been corrected to ensure proper functionality.

opw-3702040

closes odoo/odoo#154360

X-original-commit: defd5ef63b83f92f26be11d2f62b25f0f4c671a3
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-02-17 00:26:01 +00:00
Pedram (pebr) ed9f5debbe [FIX] point_of_sale: enable automatic web printing without printer
Prior to this commit, automatic printing was only functional when
a printer was configured with the Point of Sale. It did not support web
printing. This commit rectifies this issue, allowing automatic printing
to work seamlessly with or without a physical printer setup, supporting
web printing.

opw-3706400

closes odoo/odoo#154066

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-02-15 18:21:29 +00:00
Pedram (pebr) c8e6a82bc6 [FIX] microsoft_calendar: enable syncing of events without an organizer
Before this commit, an Outlook event without an organizer would fail to
sync with Odoo. This commit fixes this issue by allowing events without
an organizer to be synced from Outlook to Odoo.

opw-3701839

closes odoo/odoo#153683

X-original-commit: 4f441aa083413e475728f4f510afdbb9f15a26ef
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-02-13 16:07:29 +00:00
Pedram (pebr) 89074664bd [FIX] pos_loyalty: allow Gift Cards to be usable by any customer
Prior to this commit, Gift cards assigned to a specific partner were
restricted for use only by that partner. This commit rectifies the
issue, enabling Gift cards to be usable by any customer as intended.

opw-3689391

closes odoo/odoo#153507

X-original-commit: 15c79c3f46bcc6787efc950bd3a9a122b298f919
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-02-12 10:44:46 +00:00
Pedram (PEBR) d0d2c2d973 [FIX] point_of_sale: prevent order update when customer screen is open
Previously, the order line quantity would inadvertently update if the
Customer list screen was opened without clicking the search bar and
typing numbers. This commit resolves the issue by disabling the event
handler while a temp screen is open. Also, it enhances usability by
focusing on the search bar upon opening the Customer list screen.

opw-3634910

closes odoo/odoo#153506

X-original-commit: d792bb4b28c16b19452b7dcf06e73459ed9b8312
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-02-12 10:44:45 +00:00
Pedram (pebr) 55bcd39d9c [FIX] l10n_in: allow non-admin users to generate invoices
Before this commit, users without admin access rights were unable to
generate invoices.

opw-3701291

closes odoo/odoo#153350

X-original-commit: 27ad4379364b481276a6597bb9fab9778f07fd5f
Signed-off-by: William André (wan) <wan@odoo.com>
2024-02-09 11:57:32 +00:00
Pedram (pebr) df79efa9a4 [FIX] point_of_sale: prevent error with missing default pricelist
Prior to this commit, adding more than one pricelist to the available
pricelists and attempting to create a partner from the Point of Sale
would result in an error.

opw-3703269

closes odoo/odoo#153314

X-original-commit: 462ff7c657c22c29ffc2c522afdc9fd99068d6fb
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-02-09 11:57:29 +00:00
Pedram (pebr) 7c025b2779 [FIX] point_of_sale: prevent printing empty page
Before this commit, printing a receipt would result in an additional
empty page being printed. This not only wasted paper but also caused
issues. The problem was related to the notification element on the
print page. By removing this element, the issue has been resolved.

opw-3706233

closes odoo/odoo#152731

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2024-02-06 18:49:06 +00:00
Pedram (pebr) 179d91a0cb [FIX] pos_mrp: handle multiple order lines with kits
This commit fixes a ValueError that occurred when an order contained
two or more order lines with kits. The error was caused by the
'self.qty' expression, which failed when 'self' was a recordset.
The code has been updated to correctly handle multiple order lines
with kits.

opw-3708950

closes odoo/odoo#152053

X-original-commit: 668933002e2912f8df531b065f81777b2b491514
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-02-01 07:06:53 +00:00
Pedram (pebr) 0c2fcee654 [FIX] point_of_sale: save last preparation change on order
Prior to this commit, when adding a product to an order, navigating
back to the floor screen, and subsequently reopening the table,
clicking on "Order" would send the order to the preparation display
again. The issue stemmed from the fact that "this" was being added to
"ordersToUpdateSet" in posStore, whereas "order" should be added to
that set.

opw-3687977

closes odoo/odoo#150973

X-original-commit: 633179542d8cd7e32c51f4d6bd9c25decb2e56ae
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-01-29 18:42:33 +00:00
Pedram (pebr) a48353d602 [FIX] pos_self_order: prevent error with online payment method
Prior to this commit, using an online payment method with an image in
self-ordering mode resulted in an issue preventing the opening of the
mobile menu. The specific error encountered was:
`TypeError: Object of type bytes is not JSON serializable`

This issue arose due to the image field being of type bytes. Since the
image field is not necessary for self-ordering, this commit addresses
the problem by preventing the loading of the image for a payment
method, resolving the serialization error.

opw-3624798

closes odoo/odoo#151388

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-27 01:29:54 +00:00
Pedram (PEBR) 8afdad1ac1 [FIX] pos_sale: keep sale order references in pos restaurant
Before this commit, if the user tried to settle a sale order
in PoS restaurant, then went back to floor and then returned
to the table, the sale order reference will disappear.

The problem is that the `sale_order_origin_id` is not loaded.

opw-3550351

closes odoo/odoo#149262

X-original-commit: 13db10c1c73418ce4eabc52ef2415a1f27f1e24e
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2024-01-25 13:42:44 +00:00
Pedram (pebr) e18a2daa42 [FIX] point_of_sale: use journal account when income account is missing
Prior to this commit, when the product income account was absent, and
the product category income account was also missing, PoS would fail to
create an invoice. Now, it correctly utilizes the PoS config journal
default account.

opw-3615194

closes odoo/odoo#149816

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-23 00:52:39 +00:00
Pedram (pebr) 13649e6b46 [FIX] point_of_sale: display product attributes' images
Previously, product attributes were not displaying correctly due to
image retrieval from "product.attribute.value" conflicting with
searches based on "product.template.attribute.value" IDs. This commit
resolves the issue by ensuring the correct image display.

opw-3666883

closes odoo/odoo#148913

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2024-01-11 17:00:49 +00:00
Pedram (pebr) 2e7a18883a [FIX] point_of_sale: use system date format for date search
Prior to this commit, the date search was hardcoded to
"yyyy-MM-dd HH:mm a", inconsistent with the system's date format
display. This commit adjusts the date search to align with the system
date format.

opw-3677157

closes odoo/odoo#148827

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-11 17:00:48 +00:00
Pedram (PEBR) 457561aaa0 [FIX] microsoft_calendar: ensure syncronization with cancelled event
This commit addresses a synchronization issue with Microsoft Calendar,
which arose after the implementation of commit d9c4043.
The mentioned commit added tracking to the pre-commit process,
inadvertently causing problems during calendar synchronization.

The issue surfaced when the `_message_track_post_template` function was
called in the pre-commit phase. If the appointment function was
installed, the `_track_template` was overridden in this module, leading
to an attempt to access the removed event, which raised an error and
prevented calendar synchronization.

With this modification, the `_track_template` will not be called for
the created event that was cancelled in the same transaction.

opw-3635261

closes odoo/odoo#148439

X-original-commit: f46276590f62bc578aab954a88e495519b46a07a
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-01-10 05:04:41 +00:00
Pedram (PEBR) fb203ec2b4 [FIX] point_of_sale: prevent assignment of payment method during copy
Befoer this commit, duplicating a POS payment method led to automatic
assignment to the source payment method's POS configs. This behavior
caused issues, particularly when the POS session was open.

opw-3635647

closes odoo/odoo#147238

X-original-commit: 0725850a9d2893ea80518575735ca407cc608968
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-12-26 11:03:19 +00:00
Pedram (PEBR) 3dbfa57c41 [FIX] pos_loyalty: fix discount reward on specific category
When using a loyalty program reward with a discount on a specific
product category in PoS, it was not being applied correctly.

The reward contained a discount_product_domain with the category ids.
However in PoS the many2one fields are replaced with the
corresponding values https://github.com/odoo/odoo/commit/e7632a3bcfa60fa416fff5e2e9daaf2571c5f7f1.

To fix this, I replace the ids in the discount_product_domain with
the category name values before sending to the PoS.

opw-3502703

closes odoo/odoo#145016

X-original-commit: 494a07251c23dd7e30980dd5a455f1b37daea16f
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-12-12 19:23:56 +00:00
Pedram (PEBR) fa3c7757e3 [FIX] pos_hr_mobile, point_of_sale: fix "Scan your badge" option
The "Scan your badge" login option was not working properly when trying
to log in to the POS shop.

The barcode scanner styles were missing which caused the issue.

opw-3608077

closes odoo/odoo#145627

X-original-commit: 075fd9f7408aaced3beb6b50b5bf5d28472956e7
Related: odoo/enterprise#52464
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-12-12 17:03:38 +00:00
Pedram (PEBR) ca94faef82 [FIX] pos_loyalty: ensure customer name prints without points activity
Since the update in https://github.com/odoo/odoo/commit/d4b366f2d741f2087a947d61d7e0618492cc2bf1, the POS loyalty program stopped
printing customer names on receipts for transactions without points won
or spent. Originally, printing a loyalty program also included the
customer's name, which users relied on to print the customer's name
on receipts.

This commit ensures the customer's name is printed on the receipt,
regardless of whether any loyalty points were won or spent.

opw-3620536

closes odoo/odoo#145629

X-original-commit: 57037253a472b4a25e2be6622c505a08b7f207ff
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-12-11 17:21:14 +00:00
Pedram (PEBR) a351b73b93 [FIX] point_of_sale: capture orders with the same reference
Before this commit, if a new order was created with an existing
pos_reference, it would not be captured even though it was a completely
new order. This occurred because pos_reference was assumed to be unique.

However, there have been several customer reports of orders not being
captured when the receipt contains a pos_reference that already exists.
Some bugs causing duplicate pos_references were found but the root cause
remains unclear.

With this commit, orders are now synced even if pos_reference matches a
previous order. This prevents lost orders and allows customers to access
all their receipts via pos_reference lookup.

An investigation into the cause of duplicate pos_references needs to
continue, but this change unblocks the more serious issue of missing
orders.

opw-3499011

closes odoo/odoo#139974

X-original-commit: 269702891980eb56ddc83e199a9673b1e146d348
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-12-11 17:21:07 +00:00
Pedram (PEBR) a49fae62ac [FIX] point_of_sale: exclude internal reference in loaded products
Previously, products loaded from the background included the internal
reference in their displayed name. This behavior was due to the
'display_default_code' context, which prevents the inclusion of
'default_code' in the product name, not being utilized within the
'get_pos_ui_product_product_by_params' function.

opw-3617195

closes odoo/odoo#145644

X-original-commit: b6c87e4c3451fbb554557be95788c8e1a5e0332f
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-12-11 14:46:53 +00:00
Pedram (PEBR) ba37217944 [FIX] point_of_sale: enable date search functionality in ticket screen
After commit https://github.com/odoo/odoo/commit/4c8fddd57029608bb616c2ff4761b7d41b674986 where `date_order` was transformed to
DateTime. This modification eliminates the need for deserializeDateTime
during the search process, ensuring accurate date-based search in the
ticket screen.

opw-3621659

closes odoo/odoo#145399

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-12-08 15:57:51 +00:00
Pedram (PEBR) 2659e98a36 [FIX] pos_restaurant, *: correct receipt printing for paid orders
Prior to this commit, attempting to print a receipt for a paid order in
the PoS restaurant resulted in an error. This issue was due to the
'getReceiptHeaderData' method in the PoS restaurant using
'this.get_order()' to retrieve the order, which is not applicable for
paid orders. Additionally, this problem exists in other modules that
override 'getReceiptHeaderData'.

To resolve this, the order is now passed as an argument to the
'getReceiptHeaderData' function.

opw-3616997

closes odoo/odoo#145252

Related: odoo/enterprise#52249
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2023-12-07 21:30:05 +00:00
Pedram (PEBR) 19df0d9ba0 [FIX] pos_restaurant: exclude archived floors in get_tables_order_count
Before this commit, archiving a restaurant floor caused an error when
opening a PoS restaurant session. This issue originated from the
`get_tables_order_count` function, which executed a search based on
`restaurant.table`. Since archiving a floor does not automatically
archive its tables, the function returned information for archived
floors, leading to errors.

With this commit, we introduce an additional search to first identify
active floors in a PoS config. This refined search is then used to
filter tables, ensuring that only tables from active floors are
considered.

opw-3619830

closes odoo/odoo#145052

X-original-commit: b3ec68c4091276566db32f13346d4440128e42a9
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-12-07 11:57:08 +00:00
Pedram (PEBR) c569a0d41b [FIX] product_expiry: handle missing lot in FEFO removal strategy
Before this commit, using the First Expiry First Out (FEFO) removal
strategy led to a traceback error during stock move confirmation if a
stock quant of a product was missing its lot. This issue arose because
the removal strategy's sort key was based on `removal_date`, which is a
field related to `lot_id`.

To address this problem, the sorting logic has been modified. Now, it
uses `removal_date` or `fields.datetime.max` as the sort key.

opw-3625784

closes odoo/odoo#145274

Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2023-12-07 10:07:57 +00:00
Pedram (PEBR) 8037bec6d8 [FIX] l10n_gcc_pos: include is_gcc_country in ReceiptHeader
There was an inconsistency due to the separation of ReceiptHeader from
OrderReceipt. The 'is_gcc_country', which is utilized in both
l10n_gcc_pos and l10n_sa_pos modules within the ReceiptHeader, was not
being appropriately passed due to this separation.

This commit resolves the issue by overriding the 'getReceiptHeaderData'
method to include the 'is_gcc_country' in the ReceiptHeader data. This
ensures that the ReceiptHeader correctly reflects the necessary
information.

opw-3610862

closes odoo/odoo#144223

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-12-04 11:58:20 +00:00
Pedram (PEBR) 53d57c6daa [FIX] point_of_sale: Bring back Large Scrollbars
The Large Scrollbars feature was removed after this commit: https://github.com/odoo/odoo/commit/c087603d0b2fb6f81cdfd3afc1b94f7acb6bd2bd.
Some users need this feature.

This commit adds the Large Scrollbars back.

opw-3611148

closes odoo/odoo#144414

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-12-01 17:08:04 +00:00
Pedram (PEBR) 6a50519890 [FIX] point_of_sale: filter journals by currency during PoS setup
Before this commit, installing the Point of Sale module in a
multi-currency environment could lead to errors. Specifically, if there
were Bank or Cash journals in a currency different from the company's
default, they could inadvertently be selected to create a payment
method for a PoS configuration. This mismatch between the PoS
configuration currency and the payment method's currency resulted in
errors.

This commit resolves the issue by implementing a currency filter when
selecting Bank and Cash journals during the PoS setup. Now, only
journals matching the company's default currency are considered for
creating payment methods.

opw-3606856

closes odoo/odoo#144138

X-original-commit: 22545be292c27870cb3c4694567a45cfe9649971
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-11-30 14:48:18 +00:00
Pedram (PEBR) 8b10116410 [FIX] point_of_sale: maintain manual quantity for lot-tracked refunds
Before this commit, refunding a lot-tracked product with a quantity
greater than one in the POS  would reset the quantity to one. This
occurred even if the user manually set a higher quantity.

This commit fixes the issue by ensuring the manually set quantity for
lot-tracked products is kept during refunds. This enhancement allows
for accurate quantity retention, improving the POS refund functionality.

opw-3568867

closes odoo/odoo#144050

X-original-commit: e5989cee1cea150b86e6f3d5ae5f2fcdb108fd51
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-11-30 11:44:47 +00:00
Pedram (PEBR) e725d5615a [IMP] point_of_sale: limit pricelist item loading based on products
Before this commit, the point of sale module would attempt to load all
pricelist items from the database, even if there were a high number
defined. This could cause memory issues.

Although the products loaded into the POS can be limited, all of the
pricelist items would still be loaded, even for not loaded products.

This commit improves the pricelist loading to only load pricelist
items related to the products loaded into the POS. When new products
are loaded, their associated pricelist items are added.

This optimization prevents unnecessary pricelist item loading and
reduces memory usage in cases with large pricelists.

opw-3374866

closes odoo/odoo#143265

X-original-commit: f39e8a125c64e4a225122d975500d78e5925f4bd
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-11-30 11:44:43 +00:00
Pedram (PEBR) 7bbba71bda [FIX] point_of_sale: Include uncategorized products in sales report
Prior to this commit, products without assigned categories were not
displayed in the sales details report. This issue was due to the
report's logic excluding products that did not fall under any
specific POS category.

This commit introduces a change where products without categories are
now considered under a default category named "Not Categorized" in the
sales report. This ensures that all products, regardless of category
status, are accounted for and visible in the sales details, improving
the comprehensiveness and accuracy of the report.

opw-3594985

closes odoo/odoo#143440

X-original-commit: 6b7afc9f16133314ff6247f11db002bd3a64d289
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-11-29 16:30:18 +00:00
Pedram (PEBR) fb2ee0200d [FIX] pos_loyalty: display relevant loyalty programs on receipts
Previously, if there were multiple loyalty programs with different
sets of rules, all of them would appear on the receipt, regardless of
their applicability to the order. This caused confusion as it included
programs that were not actually applied to the customer's order.

This commit addresses the issue by altering the receipt logic. Now, a
loyalty program will only be shown on the receipt if it has either
awarded points or had points redeemed in the specific order. This
ensures that only relevant loyalty programs are displayed, enhancing
clarity and accuracy in customer receipts.

opw-3608570

closes odoo/odoo#143376

X-original-commit: d4b366f2d741f2087a947d61d7e0618492cc2bf1
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-11-28 21:21:03 +00:00
Pedram (PEBR) 1ece1e780a [FIX] l10n_sa_pos: fix blank screen and receipt issues
Before this commit, validating an order with the l10n_sa_pos module
installed resulted in a blank screen. Additionally, there was an issue
with the display of receipts when no rounding was applied.

opw-3594564

closes odoo/odoo#142510

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2023-11-21 17:17:05 +00:00
Pedram (PEBR) 18941ac6a7 [FIX] point_of_sale: load partners by email and mobile/phone number
Before this commit, partners that were not already loaded in the PoS
couldn't be retrieved using their phone number or email address. This
functionality is essential for customer recognition.

opw-3548843

closes odoo/odoo#140573

X-original-commit: 57eff2d338f96d80bf2332502a352601292109d1
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-11-07 08:00:59 +00:00
Pedram (PEBR) 029a3c85df [FIX] pos_loyalty: ensure reduce returns accumulator for 0 price lines
Ensured that the reduce function returns the accumulator even when
encountering 0 price lines. This prevents the function from breaking
on subsequent iterations due to receiving 'undefined' instead of the
expected array.

opw-3528223

closes odoo/odoo#138702

X-original-commit: ab2ed83f05d93732b0f6879ab3ca3df86213f6a2
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-10-16 07:58:46 +00:00
pedrambiria ec25a56c26 [FIX] google_calendar: get RRULE when recurrence contains more items
Before this commit: we assumed an event's recurrence only contains
RRULE, and we were getting the RRULE from the first element in the
list. But it could have EXRULE, RDATE, and EXDATE, so in this case,
the first element could be other items.

The solution is to iterate through all items and return the RRULE.

opw-2797968

closes odoo/odoo#138697

X-original-commit: f2a20457b352026c2dfb50f6a4d48d47211708f9
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-10-16 07:58:45 +00:00
Pedram (PEBR) 020f5061d1 [FIX] point_of_sale: Prevent adding archived products by barcode
When limited product loading is enabled, archived products can still be
added to orders by scanning their barcode, because
`get_pos_ui_product_product_by_params` loads archived products to
prevent errors when refunding orders.

This allows adding archived products via barcode even though they are not
visible in the POS interface.

To prevent this, we exclude archived products from the product_by_barcode
when adding products to it. This ensures archived products cannot be
added by barcode when limited product loading is enabled.

opw-3502136

closes odoo/odoo#137119

X-original-commit: 95c3807d541afe0581b636eb8394cd8f79bb770e
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-29 16:08:48 +00:00
Pedram (PEBR) 554144f992 [FIX] pos_loyalty: load Top-up eWallet product into PoS
When the limited product loading option is enabled in the PoS config,
the Top-up eWallet product was not loaded into the PoS. This caused
an error when trying to process an eWallet refund from the PoS since
the Top-up product was missing.

This commit ensures that the Top-up eWallet product is always loaded
into the PoS regardless of the limited product loading setting.

opw-3510639

closes odoo/odoo#136865

X-original-commit: 8eafd156f4a4a8680709feef8b38cbead39957f6
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-28 07:50:06 +00:00
Pedram (PEBR) d2e771b1fb [FIX] point_of_sale: use correct amount for pos order reversal
When you are using a different currency in a PoS config, invoicing
a POS order that was created in a previous session, causes an
unbalanced entry error. Because the amount_currency and balance of
the payment moves are incorrect.

Steps to reproduce:

- Create POS config with currency other than company currency
- Create order in a session
- Close the session
- Open a new session
- Load paid orders
- Try to invoice the created order

opw-3479292

closes odoo/odoo#136294

X-original-commit: 17a8b70594d97a04c2389f9fb6f0cf370c6074c5
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-22 15:06:10 +00:00
Pedram (PEBR) c10eae31ae [FIX] pos_loyalty: prevent loading a product twice
Before this commit, if a product was set to be available in the PoS,
and also existed in a reward, it was loaded to the PoS twice. This
caused issues in _loadProductProduct during the assigning of pricelist
items, and could result in missing pricelist information for a product.

opw-3487702

closes odoo/odoo#135494

X-original-commit: b64f9bfeb7782e9665ea60e57f09031b6588f883
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-14 19:20:06 +00:00
Pedram (PEBR) ced656be06 [FIX] point_of_sale: fix weighing scale
Before this commit, the weighing scale was not working properly. This
was caused by commit 60f41b1f83, which modified the getAddProductOptions
function to return both the quantity and weight, instead of just the
quantity.

The "weight" value returned was not handled in the subsequent
"add_product" call stack, causing the weighing functionality to fail.

This commit fixes the issue by using the quantity value instead of
weight in the relevant code paths. In the point of sale context,
quantity and weight are interchangeable depending on the use case.

This commit fixes the associated tests to check the weight of added
order line.

Related to PR https://github.com/odoo/enterprise/pull/47211

opw-3487707

closes odoo/odoo#135432

X-original-commit: ab88f96de580250d1e8cad7e49833c51bd6749e7
Related: odoo/enterprise#47379
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-14 11:22:56 +00:00
Pedram (PEBR) aeced503f6 [FIX] pos_stripe: get stripe payment provider based on company
The problem was that if you have multiple stripe payment providers in
different companies, it may cause issues in getting the stripe payment
provider. That was because of using sudo in
calling `_get_stripe_payment_provider`.

The solution is to filter the result based on the company.

opw-3473577

closes odoo/odoo#134930

X-original-commit: 5ebd8d76a406b6199ea2a3c337a0b7205e861d1e
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-11 07:59:58 +00:00
Pedram (PEBR) 5e81b3e3d2 [FIX] pos_loyalty: handle many2one field in reward product domain
Before this commit, if you added a domain to a loyalty reward with
one of many2one fields like [("categ_id", "ilike", "test")], it wasn't
possible to open the PoS.

This commit addresses this limitation by replacing the many2one fields
with their corresponding value. To do this the product's field type is
loaded to ensure that this improvement applies exclusively to many2one
fields.

However, it's important to note that this improvement currently handles
only "one-level" of related many2one fields. Any domain that appears
like ("categ_id.foo", "ilike", "foo-val") won't function as expected.

opw-3473103

closes odoo/odoo#134811

X-original-commit: d0a6ab8d1f89f0dd2aa6641c63b6973ae7c753ad
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-08 15:26:10 +00:00
Pedram (PEBR) f2f078e0e7 [FIX] point_of_sale: set default language for new customers
Previously, when creating a new customer from the POS interface, if
the default language was not changed in the form, an empty string
would be sent to the backend. This resulted in the new customer not
having a language set.

This commit establishes the default language selection as the user's
selected language when creating a new customer within the POS system.

opw-3466525

closes odoo/odoo#134613

X-original-commit: 82e4dc110fdd9f3a8b58e473474eb13709ddc7a4
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-08 08:29:56 +00:00
Pedram (PEBR) bce80def3a [FIX] point_of_sale: improved GS1 Barcode Recognition for PoS
Before this commit, when a regular barcode, like '3700000000370', which
could be interpreted using GS1 rules, was scanned in PoS, it was
incorrectly identified as a GS1 barcode even though it didn't contain
a product reference. This commit addresses this issue by implementing
a validation check during barcode scanning. The system now verifies
whether a scanned barcode conforms to GS1 rules and contains a product
reference. This ensures accurate barcode recognition.

opw-3468158

closes odoo/odoo#134069

X-original-commit: a62a9ef5f3a0067ed5eb772f850f6ef0fefb6821
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-04 09:19:19 +00:00
Pedram (PEBR) f1c67e5be1 [FIX] point_of_sale: scanning barcode should not update available_in_pos
Prior to this commit, when limited product loading was enabled,
scanning a product that had not been loaded yet would trigger a search
for the product without taking into account the available_in_pos field,
and it would also set available_in_pos to true.

This commit ensures that when a product is loaded using its barcode,
the behavior aligns with the changes introduced in this
commit: https://github.com/odoo/odoo/pull/87329/commits/a83c7aea37b06e8b1f04f1f02982ff577d7058e9

opw-3463427

closes odoo/odoo#134038

X-original-commit: 4fee329af13d9335f743aae39ff1a4b6ad4ee0f5
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-04 09:19:16 +00:00
Pedram (PEBR) cded24889f [FIX] point_of_sale: cannot close POS session without accounting rights
The commit f5ce6c5979e5fba1ccb7e30c8125cd7b97534925 introduced a regression that prevents closing
a POS session if the user does not have accounting and inventory
access rights.

opw-3487462

closes odoo/odoo#134055

X-original-commit: 6f43bc1972ac60e9365b40f53ee8966270e78848
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-02 07:59:01 +00:00
Pedram (PEBR) c637c86364 [FIX] point_of_sale: add quantity of product packaging
After the commit 60f41b1f83 scanning a product packaging at the
point of sale would not add the quantity to the order.

The getAddProductOptions function was updated to return a 'quantity'
variable, but the code was still using the old 'weight' variable for
the product packaging.

opw-3479699

closes odoo/odoo#133813

X-original-commit: 34dcfe24c93083c657d1a29806576f5fdcea4554
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-01 13:21:04 +00:00
Pedram (PEBR) 5e258da234 [FIX] point_of_sale: limited packaging loading based on products
Before this commit, the PoS unnecessarily loaded all product packaging,
even if their corresponding products were not loaded in the PoS due to
the limited product loading option. Adding to this inefficiency, the
`add_packagings` function would only include those packagings whose
associated products were available in the PoS, making the loading of
all packagings pointless. The optimal approach should focus on loading
only those packaging whose products are already loaded into the PoS.

Also, if you scan a product packaging that was not loaded in the PoS,
it won't fetch it from the server.

opw-3436019

closes odoo/odoo#133559

X-original-commit: f2eb06c2089da27a0dfdc5e569fe50e65103ee8a
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-30 08:08:49 +00:00
Pedram (PEBR) 6e57324aff [FIX] pos_loyalty: apply rewards for coupon programs without rules
For loyalty programs of type 'coupons' with no rules defined,
the points were not being calculated correctly in the PoS.

The pointsForPrograms function was returning an empty list [] when
no rules exist. This caused _getRealCouponPoints to skip calculation.

This commit checks the program type and returns the points
if it is 'coupons'.

opw-3457550

closes odoo/odoo#133445

X-original-commit: 25ff280dfbec7e6d6f1c0a345e1902a2ab5c0774
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-30 07:04:00 +00:00
Pedram (PEBR) d41405f88a [FIX] calendar: allow event edit regardless of notification settings
Before this commit, a user was unable to modify an event if the
organizer was not in the attendee list and when notifications were set
to "handle in Odoo" in Preferences.

Steps to reproduce:
 1. Install Calendar
 2. Create another user, Person B
 3. set notifications to "handle in Odoo" in Preferences for all users
 4. Log in as Marc Demo and create and edit a meeting for Person B
excluding himself at the attendee
 5. Log in as Admin, and try modifying the start date of the meeting to
a future date
 6. AccessError is thrown

opw-3299168

closes odoo/odoo#132745

X-original-commit: dec956f88961af0759e0108306a54c16e60d9d2e
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-23 11:12:40 +02:00
Pedram (PEBR) 13656c71c3 [FIX] *_calendar: neuter Google & Microsoft Calendar
This addresses an issue with the current Google and Microsoft
Calendar synchronization feature in Odoo. It aims to prevent
inadvertent modifications on calendars in a duplicate database.

opw-3382489

closes odoo/odoo#132698

X-original-commit: 9c94804893cf41eb91aaa8750bf2d9a59f513158
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-22 20:00:57 +02:00
Pedram (PEBR) 330f5ddb86 [FIX] point_of_sale: always show selected partner at top of list
Before this commit, the selected partner was not shown at the top if
its id was outside those first 1000, because the partner list only
searched the first 1000 partners to display.

With this commit, the selected partner will always display at the top
of the list as expected, even if its id is outside the first 1000
partners queried.

opw-3470824

closes odoo/odoo#132510

X-original-commit: a55a5951ae97c5b702ee7cde525a24df68e1e1b1
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-21 18:48:53 +02:00
Pedram (PEBR) 9e012914af [FIX] point_of_sale: ensure customer presence for split_transactions
This commit addresses an issue where `split_transactions` payments were
allowed to be added without adding a customer during the creation of
return orders. The problem led to errors during session closure.

The solution is that in the backend when creating return orders and
adding payments, enforce the presence of a customer for
`split_transactions` by showing an error.

opw-3468160

closes odoo/odoo#132262

X-original-commit: 147f559a8b8c7b107cbeeb3aa289f6d642271e86
Signed-off-by: David Monnom (moda) <moda@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-18 21:45:06 +02:00
Pedram (PEBR) c53877c774 [FIX] point_of_sale: ensure Cash/Bank journals for PoS payment
This commit enforces the use of only Cash or Bank journal types for
PoS payment methods. Before this commit, it wasn't possible to select
other journal types, but it was possible to create a journal during
the selection, with any type. This was leading to potential issues.

opw-3442317

closes odoo/odoo#132252

X-original-commit: ff274d121a17c94ca342b0f92f72d3e1b2656f98
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-18 21:44:50 +02:00
Pedram (PEBR) 80bff89cb3 [FIX] point_of_sale: reverse order of paid orders to match backend
This commit modifies the `search_paid_order_ids` function to reverse
the order of fetched orders before returning them. The change ensures
that the order of fetched orders aligns with the sorting order of the
backend, providing a consistent and expected display of data on
the frontend.

opw-3462740

closes odoo/odoo#132253

X-original-commit: 92066ea0ae2e1da7dce18d173638a9695c73e31b
Signed-off-by: David Monnom (moda) <moda@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-18 14:25:38 +02:00
Pedram (PEBR) ff3c554088 [FIX] google_calendar: ensure syncronization with cancelled event
This commit addresses a synchronization issue with Google Calendar,
which arose after the implementation of commit https://github.com/odoo/odoo/pull/94018/commits/d9c4043557c6460b3860216bdfd39a623a5e0795.
The mentioned commit added tracking to the pre-commit process,
inadvertently causing problems during Google Calendar synchronization.

During the synchronization of Google Calendar, a recurring event that
had one of its occurrences deleted resulted in Google sending both a
recurring event record and a cancelled single event. In Odoo's
synchronization process, it first created occurrences for the recurrent
event and then synced the single events. During this synchronization of
single events, the existing cancelled events were unlinked using the
`_cancel` function to remove the event.

The issue surfaced when the `_message_track_post_template` function was
called in the pre-commit phase. If the appointment function was
installed, the `_track_template` was overridden in this module, leading
to an attempt to access the removed event, which raised an error and
prevented calendar synchronization.

With this modification, the `_track_template` will not be called for
the created event that was cancelled in the same transaction.

opw-3418758

closes odoo/odoo#132174

X-original-commit: c1a455f6a46a8c936176e306f35651d60e39f869
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-08-17 16:37:14 +02:00
Pedram (PEBR) 4daaeca640 [FIX] calendar: correct event day display in the email
This commit addresses an issue in the email templates where event start
days were being displayed incorrectly, particularly for events
scheduled at specific times in timezones that experienced day shifts
during UTC conversion. The previous implementation did not account for
the necessary UTC conversion, leading to misaligned event days in the
email content. This commit ensures that event start days are accurately
calculated based on the appropriate timezone conversion, providing
correct and consistent display of event information in the email
templates.

opw-3458837

closes odoo/odoo#131967

X-original-commit: 1e1781b6242b7b6be8d5a00b1c5270ae572b09b5
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-16 09:11:21 +02:00
Pedram (PEBR) 16d090be05 [FIX] l10n_cz: add default POS receivable account
The `default_pos_receivable_account_id` was missing.

opw-3435014

closes odoo/odoo#131895

X-original-commit: 21717e22a8dc4b93a6e1b7a446b472d8202e83b5
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-14 14:52:16 +02:00
pedrambiria e756e9e533 [FIX] point_of_sale: show correct discount with extra price attributes
Before this commit, for products with attributes that do not create
variants but do carry additional costs per value, the discount
displayed on the PoS receipt inaccurately represented the price
difference based solely on the list price, excluding these additional
attribute prices. This commit corrects this issue to ensure that the
displayed discount on the PoS receipt and product screen accurately
includes any extra price from such attributes.

Steps to reproduce:
  1. Create an attribute with "never" "Variants Creation Mode"
  2. Add two attribute values
  3. Add this attribute to a product and add an extra price
  4. Enable "Discount on lines" on the user setting
  5. Change the "Discount Policy" of the pricelist that is used in
  the PoS to "Show public price & discount to the customer"
  6. Open a PoS session and add the product with an extra price
  attribute to the order
  7. Add a line discount to the order line and validate the order
  -> The discount amount is based on the listing price of the product

opw-3297713

closes odoo/odoo#131606

X-original-commit: 25f293ee6f601df5b2216d419ec0215710b9fef0
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-11 10:29:20 +02:00
pedrambiria c97cc9498e [FIX] point_of_sale: ensure accurate price display with tax exclusion
Before this commit, when a product's tax was included in its price and
the Point of Sale setting was set to "Tax-Excluded Price",
the following issues were encountered:

 1. The product screen displayed the orderline's price tax included.
 2. If the pricelist's discount policy was set to without_discount,
    and a discount was applied to a line, the old/new price would
    not be displayed.
 3. The receipt showed the discount based on the price inclusive of
    tax, rather than the tax-excluded price.

Additionally, when the product's tax wasn't included in its price and
the Point of Sale setting was set to "Tax-Included Price", the
discount displayed on the receipt was incorrect.

This commit resolves these issues, ensuring the correct tax-exclusive
and tax-inclusive prices are displayed in all scenarios, providing
accurate discount calculations on the receipt.

opw-3324090

closes odoo/odoo#130820

X-original-commit: f2569a6583ac799b1b01c023cb8ccb65d294f867
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-04 12:22:02 +02:00
Pedram (PEBR) 1dda5b84d1 [FIX] pos_loyalty: update rewards even if disallowLineQuantityChange
Before this commit, if you update the quantity of a line that it's
`disallowLineQuantityChange` it will call `_showDecreaseQuantityPopup`
to update the quantity and it will call the `set_quantity` to modify
the quantity. Calling 'set_quantity' won't call the `_updateRewards`
and it causes us to not update the rewards.

Steps to reproduce:
- In a French company, install the module "France - VAT Anti-Fraud
Certification for Point of Sale"
- Create a Loyalty program that gives you 1 point for each euro spent.
- Add items to the cart, and the points sum up.
- Remove items from the cart, the points don't subtract.
+ If points reward is added to the cart and then removed, the points
are still considered as used.

The solution is to override the `_showDecreaseQuantityPopup` function
in the pos_loyalty to call the `_updateRewards`.

opw-3430349

closes odoo/odoo#130794

X-original-commit: 1bbeaefe0f750fceba19cc9199cd7a0681fd1f7a
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-04 10:59:26 +02:00
Pedram (PEBR) a18b19284f [FIX] mail: TypeError in cleanTerm function when email is falsy
The `cleanTerm` function was throwing a TypeError ("term.toLowerCase is
not a function") when the email value of a contact was falsy (like
`false`, `null`, or `undefined`), as it was attempting to call
`toLowerCase` on a non-string value.

This was particularly problematic when two contacts had the same name
and at least one of them didn't have an email.

The solution was to make `cleanTerm` consider non-sring values as
empty string, preventing the TypeError when value is `false` from
partner having no email.

opw-3439376

closes odoo/odoo#130233

X-original-commit: 2abdf7a8635ed90f0ad26c6407b21cf3c8c60fcd
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-08-01 23:52:26 +02:00
Pedram (PEBR) b71458b185 [FIX] point_of_sale: correctly get last_session in _compute_cash_balance
Before this commit, 'last_session' inaccurately returned the newest
session, which was incorrect as the first session technically has no
preceding session. This update ensures that `last_session` does not
return any session when it is the first instance.

opw-3302489

closes odoo/odoo#128516

X-original-commit: d676f60af8f2ef45ed26e80f34bd4244f6f8157f
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-07-15 12:00:25 +02:00
pedrambiria dac0e87e0f [FIX] point_of_sale: enhance cash input handling
This commit addresses several issues with inputting cash values in the
closing and opening pop-up, particularly when the computer's locale
doesn't match the Odoo instance's locale and when using the Safari
browser. Previously, pressing the wrong decimal point would remove the
inputted value, and the input handling was not consistent in Safari.

Changes:
- Added restrictions similar to the number popup
- Ensured compatibility with localization settings, allowing the
configured decimal point to work correctly
- Improved input handling consistency across browsers, including Safari

opw-3288550

closes odoo/odoo#128308

X-original-commit: c017a9f947843dbef99546e12057452be2fd5e76
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-07-13 08:28:14 +02:00
Pedram (PEBR) 634b4990c8 [FIX] point_of_sale: handle barcode parsing errors with fallback
This commit addresses an issue with barcode parsing where the parser
might fail when dealing with different types of barcodes, such as
an EAN-13 barcode being parsed with a GS1 barcode parser. To improve
the user experience and add flexibility, a fallback mechanism
has been implemented.

This commit allows users to set a fallback using a system parameter.
This can be accomplished by adding a system parameter with a key equal
to 'point_of_sale.fallback_nomenclature_id'. The value should be set
equal to the barcode nomenclature id.

This provides a robust solution to enhance the reliability of the
system in various scenarios where different types of barcodes are
in use.

opw-3382121

closes odoo/odoo#129891

X-original-commit: 57a2eab4e4b8e7aac6932213611dbd4148f58bd8
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-07-27 16:14:24 +02:00
pedrambiria 46f21183c9 [FIX] point_of_sale: correctly compute the cash_register_balance_end
Before this commit, 'last_session' inaccurately returned the newest
session, which was incorrect as the first session technically has no
preceding session. This update ensures that `last_session` does not
return any session when it is the first instance.

Also, the computation for the `cash_register_total_entry_encoding`
when the session is closed was incorrect, and it did sum the cash
difference which led to incorrect computation.

opw-3302489

closes odoo/odoo#127572

X-original-commit: cbda861f3c2a2b39490b7148bcbba28f42f66285
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-07-06 19:46:35 +02:00
Pedram (PEBR) 35d640a2ff [FIX] point_of_sale: prevent additional blank page in print receipt
Before this commit, when a user tried to print a receipt, sometimes
an additional blank page was being printed. This was due to the
printed content slightly exceeding the printable area of the page,
leading to an unintended second page.

To solve this issue, I set the height of all elements to 0 during
printing, and explicitly set the height of the receipt container
to auto.

opw-3376131

closes odoo/odoo#127278

X-original-commit: 81feb39aa937a13b69eeb401215f84a77b57ad08
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-07-04 17:59:51 +02:00
pedrambiria 4f19f2040a [FIX] pos_loyalty: correctly compute discount with existing discount
Before this commit, if you have a discount promotion on the order,
adding a free product reward would change the discount incorrectly.

The problem is that in the `_getDiscountableOnSpecific` function the
non-discount rewards weren't excluded from `discountLinesPerReward`.

opw-3276337

closes odoo/odoo#127003

X-original-commit: 914dad0d23df4c3f8a117252a8159c07df9ee8ad
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-07-03 19:57:49 +02:00
pedrambiria 033f0f915e [FIX] microsoft_calendar: delete events correctly when reseting account
Before this commit, if you reset your microsoft callendar account and
set to remove events from Odoo, it won't remove them. The problem is
that the ('ms_universal_event_id', '!=', False) condition is not
implemented, and it can't remove the existing events.

opw-3382445

closes odoo/odoo#126739

X-original-commit: c4d8530c51e48e1f7c264b2b0c1efdab8d1fe0e6
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-06-28 23:02:37 +02:00