pos*: pos_loyalty, pos_restaurant, pos_sale,
pos_adyen, pos_six, pos_stripe
At the moment, the `pos` models don't have access to the `env` variable.
This makes using `env` inside a model rather awkward.
This PR makes it so all the pos models have access directly to `env`.
closesodoo/odoo#124320
Task: 3358456
Related: odoo/enterprise#42209
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
*: l10n_ae_pos, l10n_co_pos, l10n_fr_pos_cert, l10n_gcc_pos, l10n_in_pos, point_of_sale,
pos_adyen, pos_discount, pos_epson_printer, pos_hr, pos_loyalty, pos_mercury,
pos_restaurant, pos_sale, pos_sale_product_configurator, pos_six, pos_stripe
After the architectural refactor of the PoS App, there are two classes that make sense to merge.
In this refactoring task, we're merging them.
closesodoo/odoo#124477
Task: 3358550
Related: odoo/enterprise#42257
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Current behavior:
When you setup a stripe payment terminal, there was a rounding issue.
If you sold a product for 1.10€ with a tax of 7%, the total amount
was 1.18€, but the amount sent to the stripe terminal was 1.17€.
Steps to reproduce:
- Setup the stripe payment terminal
- Create a product with a price of 1.10€ and a tax of 7%
- Create a POS order with this product, the total is 1.18€
- Pay the order with the stripe payment terminal, the amount sent to
the terminal is 1.17€
opw-3298277
closesodoo/odoo#124372
X-original-commit: 356a6b089c020a9a83c8c7b65b588a50491c13a8
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
pos*: l10n_co_pos, l10n_fr_pos_cert, l10n_gcc_pos, l10n_in_pos,
l10n_sa_pos, pos_adyen, pos_discount, pos_epson_printer, pos_hr,
pos_hr_restaurant, pos_loyalty, pos_mercury, pos_restaurant, pos_sale,
pos_sale_loyalty, pos_sale_product_configurator, pos_six, pos_stripe
The previous commit reorganizes the files in the pos, this commit
renames all of the imports of those files to match their new location.
This is done in a separate commit to allow git to better keep track of
the changes and apply forward-ports more seamlessly.
Part-of: odoo/odoo#123498
This commit adapts the directional icons to improve the usability and
maintain consistency with the ui icons library.
task-2818586
Part-of: odoo/odoo#116641
*: l10n_ae_pos, l10n_co_pos, l10n_fr_pos_cert, l10n_gcc_pos,
l10n_in_pos, l10n_sa_pos, point_of_sale, pos_adyen, pos_discount,
pos_epson_printer, pos_epson_printer_restaurant, pos_hr,
pos_hr_restaurant, pos_loyalty, pos_mercury, pos_restaurant,
pos_restaurant_adyen, pos_restaurant_stripe, pos_sale, pos_sale_loyalty,
pos_sale_product_configurator, pos_six, pos_stripe, web
Previously, the pos assets included almost the entirety of the
assets_backend. Most of the contents of the assets_backend is completely
useless in the PoS, meaning that the PoS will load slower because it
loads much more JS than it needs. It also means that it gets all the
side effects of this bundle (global event listeners, among other things)
that we don't want.
This commit removes the dependency of the pos assets on the
assets_backend to solve these issues. The pos assets are now their own
bundle with only what is needed in the PoS.
As for the unit testing bundle, the same logic applies but
unfortunately, because the unit testing code from web that we want to
use (eg automatic cleanups, cleaning of registries, etc) depends on the
legacy code, we need to include a lot more files than would otherwise be
needed. This situation will probably be improved as legacy code is
removed from web, but in the mean time, it is not very important for
this bundle to be lean, as it's a test bundle and loading speed is less
important.
Linked to: odoo/enterprise#40502closesodoo/odoo#120070
Related: odoo/upgrade#4626
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
*: l10n_fr_pos_cert,portal_rating,pos_adyen,pos_epson_printer,pos_loyalty,
pos_mercury,pos_restaurant,pos_restaurant_adyen,pos_restaurant_stripe,
pos_sale,pos_six,pos_stripe,web
This is part of the continuous effort of refactoring pos addons towards using
more modern modules and programming patterns (such as services). After this
commit, point_of_sale addons are now left with the use of the legacy
`web.concurrency` module because of the `MutexedDropPrevious`. It's okay to keep
it because it's relatively an independent module compared to other legacy web
module.
The following summarizes the changes in this commit.
- import `_t` from `@web/core/l10n/translation`.
- convert `PosDB` to js native class
- remove use of `format` in `TicketScreen`
- To determine the cached orders are up-to-date, we now deserialize the dates
coming from the server using web's `deserializeDateTime` function. Then,
instead of initiating `cacheDate` as native js Date, we use the luxon's
`DateTime` which is supported by the web date utility methods.
- There is no need for the `format` function from `web.utils` legacy module.
- convert `PaymentInterface` to native class
- remove use of `web.config` module
- remove use of `web.time` module
- use `serializeDateTime` from web.
- remove use of `web.rpc`
- remove use of `web.utils` module
- introduce simple check for email address input
- Replace use of `web.utils.Markup` with `@odoo/owl.markup`.
- 'web.utils'.{round_decimals,round_precision,float_is_zero} copied to
'@web/core/utils/numbers'.{roundDecimals,roundPrecision,floatIsZero}.
- These helper functions are not removed from the web addon because they
are also used from other addons that are not linked to pos.
- `floatIsZero` is now computed by directly comparing the result of
`roundDecimals` to zero. This works because rounding a decimal number
which will result to zero will exactly give zero.
- remove use of `web.field_utils`
- Replace `web.field_utils.parse.float` with
`@web/views/fields/parsers.parseFloat`.
- Replace `web.field_utils.format.float` with
`@web/views/fields/formatters.formatFloat`.
- Replace `web.field_utils.format.date` with
`@web/core/l10n/dates.formatDate`.
- Replace `web.field_utils.format.datetime` with
`@web/core/l10n/dates.formatDateTime`.
- convert `PrinterMixin` and dependents to native class
- `PrinterMixin` is converted to `BasePrinter`.
- `Printer` is converted to `HWPrinter` (extending `BasePrinter`).
- `EpsonPrinter` retained its name and is converted to extend `BasePrinter`.
- Moreover, we also removed the convoluted `PrintResultGenerator`, replaced by
simply creating object with the following signature:
```js
{ successful: boolean; message?: { title: string, body?: string } }
```
- remove use of `web.Session`
- replace use of `qweb.render`
- We use `renderToElement` as replacement to templates that produces valid
html.
- Note that `renderToElement` is introduced in `@web/core/utils/render` module
which is extracted from the original `renderToString` method.
- For the epson printer template, we kept the xml layout and manually add
required xml element to contruct the xml that will be sent to the epson in
making print requests.
- use `Mutex` from `@web/core/utils/concurrency`
- remove use of `Markup` when rendering receipt info (`ticket`) in order to
render new lines.
- Remove use of `jquery` in `htmlToImg`.
closesodoo/odoo#117231
Related: odoo/enterprise#39078
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Currently the POS does not load if a Stripe payment method is configured and there is no internet connection.
This commit fixes the loading of Stripe resources
to allow the opening of the POS and the display of related errors
task 3177045
closesodoo/odoo#118946
X-original-commit: 00b113721cf6a1de862794f06bd3ba293039ecd5
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
*: l10n_fr_pos_cert, point_of_sale, pos_discount, pos_hr,
pos_hr_restaurant, pos_loyalty, pos_mercury, pos_restaurant, pos_sale,
pos_sale_product_configurator, pos_six, pos_stripe
Continuing to move things out of the Chrome god component, this commit
does the following things:
- moves the showScreen and showTempScreen methods and the corresponding
closing methods into the pos store so that components that need them can
access them through the pos service in a more explicit way. To that end,
these methods have been removed from PosComponent and Gui.
- introduces a popup service instead of using a bus in the env, this is
mechanically very similar but closer to what's done in web and hopefully
a first step to using the dialog service instead. It also removes the
showPopup method from the PosComponent and Gui, to make components
depending on the popup service explicit.
- makes the number buffer into a service instead of being a directly
imported singleton, which will enable it to be used with hooks instead
at a later point, and allows easier dependency injection in tests.
- removes showNotification from the PosComponent and Gui, the
notification system was already converted to a service in a previous
commit for the same reasons as showPopup and the end goal is to use the
notification service from web to reduce duplication.
closesodoo/odoo#111844
Related: odoo/enterprise#36668
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Before this commit: if a non-admin user captured a payment with
PoS Stripe, an error occurred in UI. The problem is that only the
"Administration / Settings" group can have access to the payment
provider.
The solution is to use super user mode.
opw-3120441
closesodoo/odoo#112006
X-original-commit: de096c08f5766f3fb2b2438730295195cdd9af16
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
*: l10n_co_pos, l10n_fr_pos_cert, l10n_gcc_pos, l10n_in_pos,
l10n_sa_pos, pos_adyen, pos_discount, pos_epson_printer,
pos_epson_printer_restaurant, pos_hr, pos_hr_restaurant, pos_loyalty,
pos_mercury, pos_restaurant, pos_sale, pos_sale, pos_sale, pos_sale,
pos_sale, pos_sale, pos_sale_loyalty, pos_sale_product_configurator,
pos_six, pos_six, pos_six, pos_six, pos_stripe, pos_stripe
Previously, the point of sale module used a custom inheritance system
for models and components. This system being non-standard, it makes it
hard for newcomers to understand how to use it or for people with
experience in the pos code base to understand how things are done
elsewhere. This commit removes the "registries" system from the pos
modules and adapts existing code to use standard inheritance mechanisms,
ie extending classes directly, and using patch to modify behaviour in
place.
task-3119628
closesodoo/odoo#109928
Related: odoo/enterprise#35795
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Before this commit:
If you make a PoS payment using a Stripe terminal, you will have
the following JS Traceback:
```js
TypeError: Cannot read properties of undefined (reading 'data')
at Proxy.captureAfterPayment
```
This happens on the line:
`capturePayment.charges.data[0].payment_method_details.card_present.brand;`
It occurs as Stripe API most recent version does not provide the
`charges` value anymore.
> The charges property on PaymentIntent has been removed
source:
https://stripe.com/docs/upgrades#2022-11-15
After this commit:
We skip the data if not mentioned on the JS side.
In addition of that, we use the `_stripe_make_request`
method of the Stripe payment provider as it
force in its header to use a certain Stripe API version
compatible with the features that we are looking for.
opw-3097460
closesodoo/odoo#108851
X-original-commit: 6a6057caf63d7e6a60dac190b2ea1ebb954d8f6a
Signed-off-by: Loan (LSE) <lse@odoo.com>
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Keep the manifests as light as possible, to easily see custom behavior/content.
Complete the work of previous commits cleaning the manifests content:
* 42bad1a6d2
* ef7005f524
and make sure this kind of cleanup commit is not necessary in the future
because it is now automatically verified by a dedicated test.
closesodoo/odoo#107735
Related: odoo/enterprise#34903
Signed-off-by: Julien Castiaux <juc@odoo.com>
*: l10n_co_pos, l10n_fr_pos_cert, l10n_gcc_pos, l10n_in_pos,
l10n_sa_pos, pos_adyen, pos_discount, pos_epson_printer,
pos_epson_printer_restaurant, pos_hr, pos_loyalty, pos_mercury,
pos_restaurant, pos_restaurant_adyen, pos_restaurant_stripe, pos_sale,
pos_sale_product_configurator, pos_six, pos_stripe
We are about to refactor most of the Javasript code base of the point of
sale and related modules. In doing so, we will move a lot of files and
modernize the entire code-base. In order to avoid diffcult rebases,
their conversion to odoo-modules is done as a first step to avoid
getting lots of conflicts on files that were unindented, which marks the
entire file as being in conflict. Conflicts will occur during forward
ports but they will be easier to manage as the changes will be much
smaller in scope, and the author will have the context of the change
that causes the conflict in mind when dealing with it.
closesodoo/odoo#107621
Related: odoo/enterprise#34910
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Currently if an error occurs on the server side it is not
reported to the POS interface and therefore to the user.
With this commit all responses to requests to the Stripe
server are managed in the POS so that the cashier is correctly
informed of any errors that may occur
closesodoo/odoo#104870
X-original-commit: a9c794ed31cfe1527f0e480729212859338bca60
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
In this commit we the fix the payment methods form view
because it was broken after changing the implementation
of the <group> element to the new `grid`format.
closesodoo/odoo#102519
X-original-commit: 3450e48198c6dd1c26379ffd09aeaaaefa1fdc13
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
This is analogous to pos_restaurant_adyen and adds support for the two
American tipping flows:
- customer tips immediately themselves after paying using the TipScreen
- waiter adds tips end-of-day using paper receipts using the TicketScreen
To allow for tipping an optional amount= parameter was added to
stripe_capture_payment and the transaction_id on the paymentline was
saved a bit sooner so it can be used in the backend in set_no_tip and
_update_payment_line_for_tip.
Stripe docs:
https://stripe.com/docs/terminal/features/collecting-tips/on-receipt
task-2979312
closesodoo/odoo#99973
Signed-off-by: Masereel Pierre <pim@odoo.com>
Changing the name of model payment.acquirer to payment.provider
and everything that it touches. It is technically incorrect to
use the term "acquirer" for systems that only provide a service
of payment.
After this commit the model payment.acquirer and all related to
it will be renamed to payment.provider.
Task - 2842088
closesodoo/odoo#90899
Related: odoo/upgrade#3542
Related: odoo/documentation#1981
Related: odoo/enterprise#27131
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
We need to complete the onboarding of Stripe connect or
record the secret key
Actually there are not a direct link to payment from POS
So we add a link from the Stripe payment method to Stripe view form
closesodoo/odoo#92869
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Add a stripe payment provider to the POS
To be able to use this payment provider, you must have configured Stripe in Odoo
closesodoo/odoo#92421
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>