Commit Graph
122 Commits
Author SHA1 Message Date
Antoine Vandevenne (anv) d5bee8b86f [REM] payment(_alipay,_demo,_paypal), website_payment: drop fees support
The "fees" or "extra fees" or "customer fees" feature was meant to make
customers pay for the processing fee charged by the payment provider
they choose to make their payment. The fee was also displayed on the
payment form to deter customers and encourage them to choose another,
cheaper, payment provider.

In practice, it didn't hold up because:
1. the provider's API must allow sending the fee as a separate amount,
   and PayPal was the only supported provider to do it;
2. charging extra fees is highly discouraged by providers, and forbidden
   in Europe;
3. the final fee amount depends on the customer, country, payment
   method, risk profile... rendering charging the actual fees amount
   infeasible;
4. most of the time, only one payment provider is enabled at a time,
   thus alienating customers who would have no other choice than paying
   the fee;

task-3358581

closes odoo/odoo#132104

Related: odoo/documentation#5517
Related: odoo/upgrade#5053
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-08-19 09:06:59 +02:00
Gurupreet Singh 94d4205751 [IMP] sale: allow the customer to sign in the quotation
Previously, customers were not allowed to sign a draft quotation.
We consider that if the customer has access to the quote, he should be able to sign/pay it (instead of getting some strange feedback that the order is not in a state requiring signature/payment)

task-3340541

closes odoo/odoo#124486

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-07-14 15:34:46 +02:00
Florian Charlier 77f9ff50db [REF] *: use onboarding module
* = account{_payment}, base, onboarding, payment{_stripe},
sale{_management}, web, website_sale

Use the dedicated onboarding module introduced in 16.0 instead of
the res.company model to store onboarding progress.

It allows
 * onboarding steps to be reused across panels
 * to support steps that should be completed per-database or per-company
 * to clean the res.company model from many fields and methods,
 * to remove many views, controllers, actions

Module-specific notes:
* account: We also clean the remaining two steps that are not
part of an accounting panel but make the most sense to be kept here.
* account_payment: Following 8e4e8eb8, the payment provider step is
added to the invoicing onboarding panel. We apply this change here too.
Also impacts the website_sale_dashboard panel (see related ENT PR).
(The "sale tax" one is currently used for to the website sale dashboard).
* payment: Note that the step was already not part of an onboarding
panel within this module.
* website_sale: We clean
  * a field not used (The website_sale dashboard onboarding panel used
  the payment_provider_onboarding_state field).
  * a method that was only called from website_sale_dashboard, so it is
  moved there. See related ENT PR.

Includes a few tests.

Moving views/templates/styling, as well as cleaning residual onboarding-related fields and methods in base, including populate.

This also includes restoring the "onboarding_complete" overlay panel
animating it to disappear after a few seconds so that it doesn't hide
text and block buttons to re-open steps.

Task-3025136

Part-of: odoo/odoo#104223
2023-06-30 23:37:50 +02:00
Victor Feyens 17bece3e79 [REF] sale,*: remove locked (done) SO state
It's not a specific state, it should be considered separately,
as a boolean.

This allows to reduce code complexity (flows should not rely (much) on
the locked logic) and to have a clearer flow.

Task-3163931

Part-of: odoo/odoo#115871
2023-06-22 15:40:51 +02:00
Denis Ledoux 58ea5e7b43 [IMP] http.py: do not inject context by default in JSON routes
Before this revision, when you pass `context` in the arguments
of a JSON routes, this one gets automatically injected
in the environment context.

This is not the case for regular HTTP routes.

It makes sense to propagate the context for the JSONRPC protocol,
JSON routes used by the backend, such as `call_kw`,
but it doesn't make sense to pass this context automatically
for any other kind of routes, such as front-end routes
or routes used by custom Javascript widgets.

This change brings a more unified behavior for routes
of types HTTP and JSON.
In addition, most developers were not aware of this "feautre",
that passing `context` in the arguments of a JSON route leaded
to the injection of this context in the environment context.
This is actually reflected by the diff size this changes required,
only a dozens of routes needed to be adapted, to manually
add the context in their route arguments and to inject it
in their environment context.

closes odoo/odoo#121726

X-original-commit: a7a5655631e6d5b05fd2ba3d0c80617aae6d9cfe
Related: odoo/enterprise#41229
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2023-05-22 11:43:04 +02:00
David Tran 42c404b262 [FIX] sale: log notes with wrong quotation viewer
The note "Quotation viewed by customer" posted when a public/portal user
access an order came with the order's partner name instead of the actual
user's partner name

This made confused for internal users to see something in internal note
like **Colleen Diaz** with a message **Quotation viewed by customer
Nicole Ford**

This commit makes sure to use the right partner name except the
quotation is viewed anonymously (with access token)

closes odoo/odoo#121571

X-original-commit: 8e37dcee1f5106e69d5784439e2657acf5706e4e
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-05-16 20:33:26 +02:00
Horacio Tellezandchevalierv 216fa84fbe [ADD] sale: add a products catalog view on the sale order
Currently, Fields Sales are struggling to create quotations or sale
orders directly from the customer place. One of the issues is that it
is not easy to quickly add products to the SO. Products must be added
one by one and, in mobile, it requires completing a form with
quantities, ... for each new line.  

This commit introduces a catalog view that allows users to select
products in a faster and easier way than before, both in desktop and
mobile view.

Task - 3062080

closes odoo/odoo#106382

Related: odoo/enterprise#37915
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Co-authored-by: chevalierv <vcr@odoo.com>
2023-05-12 20:51:51 +02:00
Valentin Chevalier 0bcd364def [FIX] sale: check the right partner in the access token
When using a different invoicing address for a partner on a sale order,
an error is thrown up. This is caused by checking the wrong partner in
the access token.

opw-3298228

closes odoo/odoo#120822

X-original-commit: bd76e9d6174d2154f8685dbaa2c8dcf1678ac175
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2023-05-09 07:08:48 +02:00
Horacio Tellez 8164ac4e22 [FIX] sale: use billing address whenever possible
In the case of transaction linked to sales orders it is
more appropiated to use the invoice partner related to the
sale order than its main partner.
After this fix the invoice partner of sale orders will be
used for transactions linked to it.

opw - 3212748

closes odoo/odoo#119962

X-original-commit: 6eaf11d1ac0d9fc3cd9d458e6ee1f27159216d40
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Horacio Tellez Perez (hote) <hote@odoo.com>
2023-04-27 16:10:47 +02:00
Valentin Chevalier 7e42f381c3 [MOV] website_sale: move variants logic from sale to website_sale
Currently, `website_sale` uses the same logic as `sale` to show the
product variant configuration.

This commit aims to separate this logic and let each module handle its
own product variant configuration.

task-3056806

Part-of: odoo/odoo#106511
2023-04-24 08:38:11 +02:00
Horacio Tellez ddda5d4a26 [IMP] payment: allow the public user to pay with tokens
Before this commit the public user did not have access to tokens or the
possibility of saving payment methods.

When receiving a link to pay the customer (even if not logged in) should
be able to use tokens saved by the parter of the document and also save
new payment methods. This is intuitively correct: as the possesor of the
link, the customer have rights to pay with tokens linked to the partner.

After this commit tokens linked to the partner of the document will be
visible to the public user and also the possibily to save payment
methods.

Task - 2799296

closes odoo/odoo#104472

Related: odoo/enterprise#34792
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-03-08 11:36:53 +01:00
Valentin Vallaeys (vava) e534ab41e7 [REF] payment, (website_)sale: factorize payment values logic in controllers
The payment values in the Qweb context of sale, sale_subscription and
website_sale were computed separately, although there is a large common
basis. This split made it hard to communicate between modules and
generated a lot of duplicates. The new function `_get_payment_values`
in sales is now used as a common basis method for all sale_* modules to
get the common payment values.

closes odoo/odoo#107788

Related: odoo/enterprise#34922
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2023-02-03 17:40:58 +01:00
Demesmaeker 83c52575d0 [REF] product,repair,(*_)sale(_*): unrequired pricelist
Removes the constraint of using a pricelist and makes all sales flows
rely on the currency of the sale order (or repair order)

task-2735672

closes odoo/odoo#84920

Related: odoo/enterprise#24716
Related: odoo/upgrade#3642
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2023-01-18 21:08:52 +01:00
Antoine Vandevenne (anv) 42e90fcf15 [FIX] payment, *: re-use the partner of the document
*: account_payment, sale, website_payment, website_payment

opw-3097856

closes odoo/odoo#109695

X-original-commit: a452221c51f5659c88cb479ded192a2ad395e7d6
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-01-11 22:43:22 +01:00
Jordan D. (Joda) ae1272428c [FIX] sale: disable confirmation warning after cancellation on portal
When cancelling a quotation using the portal, the state will remain on
sent but the message given with it will be displayed on the chatter.

This bug is caused by the framework trying to display a cancellation
wizard.

opw-3084216

closes odoo/odoo#108476

X-original-commit: c662da9f1c8926cb2cebbb632a3621e2e26e2f36
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-21 19:34:58 +01:00
Victor Feyens e210860200 [CLN] sale: clean company & settings python code
Cleanups and fixes/improvements extracted from another task
on the settings of sale.

* indentation
* code simplification
* privatize method not meant to be called by rpc
* double quoted strings for strings shown to users, single quoted for
technical strings
* translate onchange warning message

closes odoo/odoo#107897

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-13 20:06:53 +01:00
niyasraphy 89c95544d6 [FIX] *: make some user errors translatable
*: base, account_payment, l10n_ar, mrp_subcontracting, point_of_sale, pos_restaurant, purchase, sale

closes odoo/odoo#107264

X-original-commit: edd928cd0c63a01d1ee8b28ed344f61e9b6d0b54
Related: odoo/enterprise#34676
Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-12-09 11:48:50 +01:00
Demesmaeker 05a8f79b46 [IMP] payment, *: better handle company mismatches
Rather than hiding all payment providers and payment tokens from the
payment form, a warning is now shown to the user if their company is
not the same as that of the document (SO, invoice, ...) they're paying
for.

task-2983985

closes odoo/odoo#100375

Related: odoo/enterprise#31424
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-11-24 19:24:57 +01:00
Antoine Vandevenne (anv) 4f8b9d0a21 [REF] sale: extract a _get_payment_values from the portal controller
task-3048314

closes odoo/odoo#105199

X-original-commit: ae9e0cc50345db2bbbf0404fe6ac474b7496dd9c
Related: odoo/enterprise#33720
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2022-11-08 09:41:03 +01:00
Victor Feyens d41ed0b17e [FIX] payment,*: unable to access the documents of your companies
Task ID - 2960827
opw-2954181

closes odoo/odoo#99512

X-original-commit: 42ea4244692dc4b6e1f5917a715b1552bd223928
Related: odoo/enterprise#31037
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-09-15 11:05:07 +02:00
Horacio Tellez f7b8f07501 [IMP] payment: rename of acquirer to provider
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

closes odoo/odoo#90899

Related: odoo/upgrade#3542
Related: odoo/documentation#1981
Related: odoo/enterprise#27131
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-09-09 13:38:08 +02:00
Victor Feyens bf55e1a7ea [IMP] sale: privatize portal methods not meant to be called in rpc
Part-of: odoo/odoo#98068
2022-09-01 19:16:49 +02:00
Martin Trigaux ffc525419a [IMP] base: avoid render with env mixup
The render API was confusing as mixing the access to the report and
the rendering env.

The ambiguity was present for code such as
`report.sudo()._render(record_ids)` where it was not clear if the
`sudo()` is needed to access to `report` or to `record_ids`. For low
priviledge users (such as portal or public), it was common to use
`report.with_user(SUPERUSER_ID)._render(record_ids)`.

This PR changes the render methods signature to be `api.model`. The
`report_ref` can be:
- ir.actions.report external id
- ir.actions.report id
- ir.actions.report recod
- `report_name` value

This will allow to call the report methods with any user and no longer
need to use `with_user(1)` to render reports as public user.

Task-id 2670865

closes odoo/odoo#91341

Related: odoo/upgrade#3650
Related: odoo/enterprise#27323
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-08-02 11:48:46 +02:00
Horacio Tellez c1aa010af7 [IMP] payment: filter out acquirers based on the amount
This commit adds the possibility to define a maximum payment amount that
a given acquirer can process. If the payment amount exceeds the value,
the acquirer is filtered out of the available acquirers listed on the
payment forms.

While we're at it, the field `country_ids` is renamed to
`available_country_ids` to better depict that it is not a property of
the acquirer, but a configuration option. It will also be coherent with
the field `available_currency_ids` that is expected to be added soon.

Task - 2162165

closes odoo/odoo#82411

Related: odoo/enterprise#24412
Related: odoo/upgrade#3703
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-07-26 13:24:57 +02:00
Horacio Tellez 557a3e28ed [IMP] payment, sale: prevent paying for a canceled SO/invoice
Before this commit, sales orders/invoices that had been canceled could
still be paid from a payment link. Now, when trying to pay for a
canceled sales order/invoice, the amount to pay is set to zero.

Task - 2735019

closes odoo/odoo#85728

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-01 15:22:55 +02:00
Victor Feyens c5939b6662 [FIX] sale: log notes in salesman/company language
The note "Quotation viewed by customer" posted when a public user
accesses an order on the portal (with a token) was translated in
the "automatic" language, i.e. the website or user (or browser language).

This doesn't make much sense since log notes are not meant to be shown to
the user, only to the internal user(s) (/salesman).

This commit makes sure that the message is not translated in the website/customer lang,
but in the salesman or company language instead.

Task - 2836421

closes odoo/odoo#90318

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-05-30 12:11:28 +02:00
Valentin Chevalier 691ab5835b [IMP] payment, *: hide tokenization checkbox when paying a subscription
*: account_payment, sale, website_sale

Users should not be able to discard the tokenization of their payment if
they pay for a subscription.

This commit introduces a new helper method to better predict when the
tokenization checkbox should be shown or hidden. This also ensures that
the behavior will be the same across all modules.

task-2695201

closes odoo/odoo#91860

X-original-commit: 1d8dc53f8ed2a967b35213bc913cdfbc42ff15bc
Related: odoo/enterprise#27568
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-05-20 13:15:46 +02:00
Antoine Vandevenne (anv) fadff0cc91 [REF] payment, *: make helper methods on portal private
*: account_payment, sale

This doesn't change anything from a technical point of view, but it
helps to consistently assess whether a method is attached to a route or
not, only by looking at the class' skeleton.

closes odoo/odoo#91359

X-original-commit: 93de42458ed0a7df20a7bc2f2c2b106386293c78
Related: odoo/enterprise#27330
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-05-13 18:11:16 +02:00
Merlin (megu) b4e9cda4bf [FIX] sale,sale_product_configurator: company access in price_compute
There is an access error when using the product configurator in a mutli-
company environment

Steps to reproduce:
1. Install Sales
2. Go to Settings > General Settings > Companies and create a new
company
3. Go to Settings > Sales > Product Catalog and enable Product
Configurator
4. Switch to the new company
5. Go to Sales > Products > Products and create a new product
6. Set the product's company to the new company
7. Add the 'Color' variant on the product with at least two values
8. Go to Sales > Orders > Quotations and create a new quotation
9. Add the new product to the quotation, the product configurator shows
up
10. Increasing the number of product in the configurator will put the
total to 0 and the http request `/sale/get_combination_info` raises an
access error

Solution:
Pass the company in the context of the rpc call

Problem:
If we are in a secondary company, we try to acces the product of this
company from the default company in `price_compute`, which raises the
error

opw-2826227

closes odoo/odoo#91266

X-original-commit: 5477e1bce1a3791b39d0f6de9d382416fb4b6ebf
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-05-13 12:00:07 +02:00
Horacio Tellez 89bb842246 [FIX] payment: avoid a mismatch between partner's and acquirer's company
In a multi-company environment, a partner of company A should not be able
to make payments for company B. With this commit, if we detect a
mismatch between the companies, a UserError is raised.

Task - 2627751

closes odoo/odoo#91189

X-original-commit: 6064cf2e98f16b42f516dcd1b0793a62436bab33
Related: odoo/enterprise#27245
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Horacio Tellez Perez (hote) <hote@odoo.com>
2022-05-12 13:43:36 +02:00
Adam Heinz aafe2e35e7 [IMP] sale: simplify API of create_product_variant method
### Current behavior before PR:

The `product.template` model has a nice function `create_product_variant` that unfortunately expects its input to be in JSON.

### Desired behavior after PR is merged:

JSON decoding is moved into the controller, such that the function can be called as expected.

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#88989

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-04-21 18:45:22 +02:00
Gorash 880954ebfc [IMP] *: remove _render from ir.ui.view and simplify report
There were inconsistencies in the calls to `_render`.
* the view context could contain information that misled developers.
Indeed, the context and value of the view are not supposed to be found
in the rendering. Thus by calling `ir.qweb` with the name of the
template, we ensure that there is no unwanted information and in
addition the cache key is that of the name of the template which saves
a query.
* the context used for rendering was modified by a method on
`ir.ui.view`, except this is not information used by this model. There
is now a `_prepare_environment` method residing on `ir.qweb`. This
method allows to modify the value dictionary as well as the context in
which the rendering will be done. This preparation of the data as well
as my security check is done only once per rendering. This also saves
some queries
* Freeze options for rendering were inconsistent. It could be that
options on which rendering depends were not part of the cache key. Thus,
depending on the user who generated the generation of the rendering
function, there was or was not information in the template. For example
for automatic branding. This is no longer possible, because it is the
context that is used. The options serving as a cache key are only
recorded for information (for the profiling system for example). A
simplification of the `ir.qweb.field` models could be made.

The report rendering and call `ir.qweb` instead of `ir.ui.view`.

Part-of: odoo/odoo#85110
2022-03-29 10:56:15 +02:00
Victor Feyens 213e0ba734 [IMP] sale: clean sale order portal page rendering
* Remove old unused parameters
* Move `backend_url` logic from qweb to python
* add comments, clean and simplify some code/logic related to portal
page of sale orders

Part-of: odoo/odoo#84644
2022-02-28 14:46:56 +00:00
Victor Feyens 248e9d8d67 [IMP] sale: factorize shared portal code
Part-of: odoo/odoo#84644
2022-02-28 14:46:55 +00:00
Victor Feyens a414a0908d [IMP] sale: portal improvements
* Rename decline route to make sure there won't be any conflict with 
another controller method

* Use new translation API (pass string format params to the translation 
method)

* always pass token param to _message_post_helper, it should correctly 
manage any falsy value as parameter

* code cleanup

Part-of: odoo/odoo#84644
2022-02-28 14:46:55 +00:00
root c33419cfd2 [FIX] sale: allow overriding portal domain
Before this commit the only way to modify the domain is to completely override portal_my_quotes/portal_my_orders.
Since this function is so big this is not clean/easy to do.
By creating a separate function we can simply override it and we can reuse the same domain in two places.

closes odoo/odoo#84886

X-original-commit: ff50844da0e4423372746e767f482a2a71148be4
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-18 14:29:13 +00:00
Xavier BOL (xbo) c2b0656c12 [IMP] sale: create some hook methods to avoid duplicating code
This commit moves some code used in methods for `/my/quotes` and
`/my/orders` because the code was duplicated for the both routes.
So, with this commit, we can now call those hooks when we need this code
in another routes.

task-2648955

Closes #82379
2022-02-14 13:23:05 +01:00
Tiffany Chang (tic) c899bfcd84 [IMP] sale_mrp: show MTO MOs in SOs portal
In order to provide more transparency, we display any MOs linked to a
SOs via MTO linkage. This includes linkages made via reception report.

Part of Task: 2662730

closes odoo/odoo#79627

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-01-20 12:30:05 +00:00
Martin Trigaux cd464d84d7 [FIX] sale: render the report as superuser
Same as 5dde19c92ecee, sudo is not enough but the report needs to be
rendered with the user 1.
The access token proves the user has the access, the fact that he is a
portal, employee or public should not change the result

closes odoo/odoo#80491

X-original-commit: 66ab2ae213f05b055a032d0810de1de9334741ac
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-26 20:37:46 +00:00
Kamen Zhekov 2b832269f4 [IMP] sale*: merge configuring products and opt. products modals
The changes concern the following modules:
- sale
- sale_product_configurator
- website_sale
- website_sale_product_configurator

When optional products are enabled and a user adds an item to the cart, the
modal popup does not allow further modifications to the main product based
on its template. If the user wants to change the color or the material, they
have to close the popup, modify the product and open it back up.

The same is applied when Add to Cart is active, and the user cannot configure
the product at all after clicking the add to cart button.

This change will make it possible to change the product variants without having
to close the modal, and configure the product when using the "Add to cart"
button when it's enabled.

The added configuration step is needed for some cases like the following:

1. When adding a product that had variants directly from the /shop page before,
the first variant was added by default and configuring it was impossible without
explicitly going on the product's page and configuring it from there. This 
behaviour made no sense, and it's the reason the "optional products modal"
(which should no longer be called that) is opened when the product is not 
configured even if there are no optional products.
2. When going through the product's page, and there are optional products enabled
for the product getting configured, then it's nice but not necessary to be able to 
configure the product further while choosing and configuring the optional products.
This doesn't add an extra step in any case, it just makes it possible to still configure
your product in the modal.
3. If there are no optional products, the configuration made on the product's
page is taken into account and the product is directly added to the cart without 
opening the modal, which is the same behaviour as previously.

Only one modal is shown, depending on the situation:

- For the website flow, if the product is not configured and has variants or has
optional products (or both), a popup shows that allows for configuration + 
choosing and configuring optional products.
- For the sales flow, there was already a configuration popup, so the optional
products modal is only shown when there are optional products and replaces
the first instead.

Some tests were adapted to function with the new product configuration modal:

- The steps checking for the text mentioned above are removed
- Triggers were adapted to the modal for products that were previously added to cart
  with their default variant
- Various other small adjustments

task-2541663

closes odoo/odoo#73086

Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-08-30 13:27:44 +00:00
Antoine Vandevenne (anv)andVictor Feyens 573ed74c12 [REF] payment, *: refactor online payments API
This commit replaces the old online payments API of the `payment`
module with the new one and adapts to it all the implementing modules.

See the merge commit for more details.

task-2085989
task-2119838
task-2165982
task-2289255

Co-authored-by: Victor Feyens <vfe@odoo.com>
2021-03-30 09:25:51 +02:00
Laurent Stukkens (LTU) 009bcc59fe [IMP] sale_timesheet: adapt timesheet sections in portal
Prior to this commit:

    * The portal timesheet section was only visible in invoices when
      invoicing policy was set to delivery.
    * The portal timesheet section was not visible on orders.

After this commit:

    * The portal timesheet section will be displayed for both delivery and order invoicing
      policies.
    * The portal timesheet section will be available for orders.

task-2388500

closes odoo/odoo#62516

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-11-25 18:13:11 +00:00
Andrea Grazioso (agr-odoo) c97e605457 [FIX] sale: keep card info on form save
Configure card payment provider (stripe, Authorize, etc) in test mode
Allow the customer to decide if saving payment info
Go to web shop, fill cart and checkout
Select provider and check "save payment method"

After payment the card info is not saved:
the related check variable is overridden in the process.

Note: this occur only when using the provider site.
S2S payment via Odoo follows a different flow

opw-2335237

closes odoo/odoo#61351

X-original-commit: dc18fdba1d4e0d38df0ebce4eed46f8ad08f4821
Related: odoo/enterprise#14597
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-11-04 16:37:30 +00:00
Nicolas Martinelli 691c14c070 [FIX] account, purchase, sale: portal access error
- Install account / purchase / sale
- Ceate an internal user without any access rights
- Go to `/my`

A 500 error is raised because of an AccessError.

When the user has no access rights to any of the mentioned applications,
the `search` call returns an AccessError.

We prevent the access error and return 0 as a fallback.

opw-2367559

closes odoo/odoo#60849

X-original-commit: 54ef98c613219aba3bda41817f7767261b8092d2
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-10-27 15:36:48 +00:00
Adrian Torres b7017e58cc [FIX] *: adapt business code to function-redefined error
This commit adapts the business code in which
class/module/function/method redefinition took place so that it no
longer happens and the pylint test passes.
2020-10-16 12:56:52 +00:00
Victor Feyens 2da7bc2adb [REM] portal, *: remove archive_groups dead code
PURPOSE

Clean code and be and more performance oriented.

SPECIFICATIONS

Various portal pages hold references to archive_groups. It was a summary
of customer documents for portal, containing a count of all documents split
by model.

Currently its computation is not used. Indeed archive_groups is displayed
only in 'my_details' page that does not hold any document-based reference
or code call. Other calls to archive_groups are dead code as the result is
not used. Since 13.0 it is even not computed on standard pages to speedup
their load (as it was not used).

It is not used anymore and its computation and references can be removed
safely, especially with v14 in mind for which we want to remove dead code
to maintain.

Followup of odoo/odoo#55228

LINKS

Task ID-2329081
PR odoo/odoo#55800
PR #12368

closes odoo/odoo#56859

X-original-commit: e75086000ee4317b2ad2994db5d906fbcbd5081f
Related: odoo/enterprise#12830
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2020-09-01 10:30:32 +00:00
Damien Bouvy 2cc8af737a [FIX] sale,payment: remove useless comments
DBO won't be here anymore 👋

This is my last commit, I had to find something harmless.

Task-NaNNaNNaNNaNNaNNaN

closes odoo/odoo#56789

X-original-commit: fc92728fb2aa306bf0e01a7f9ae1cfa3c1df0e10
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-31 09:59:54 +00:00
Jeremy Kersten 73b4e9b1b6 [IMP] portal,*: /my counter async
Before this commit, the time to compute all counters was making the rendering
of the portal page slow.

Now the count is done in rpc after the loading of the page.

Now you can decide which part you want to show on the portal, and only compute
for these one.

It is not because you have purchase installed for your internal process, that
it means that your supplier use your portal and it avoid the computation for
all end users.

We parallelize the counters in arbitrary 3 rpcs.

closes odoo/odoo#55999

Related: odoo/enterprise#12456
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-08-17 15:59:03 +00:00
Victor Feyens 71f3fa991c [IMP] *: disable unused archive_groups feature in portal
The archive groups feature allows the user to have fast access to
records of a given month, under its details information.

But since the details section isn't shown anymore on portal sub-pages,
the feature is computed for nothing on (most) pages.
Removing this computation avoids a read_group call on portal subpages
(multiple potential queries).

This commit disables the feature until a total removal in master.
my_details is only truthy on the /my/account portal page, where no
archive_groups is given anyway (and the value is set to True only in the
rendered tempate itself).

X-original-commit: 40c57fafdd5651a522891ab68affe38933ea5202
2020-08-03 07:23:30 +00:00
Victor Feyens 34fb9f3159 [IMP] portal,*: do not compute record counts for portal subpages.
The record counts are only useful for the badges displayed in /my &
/my/home.
By avoiding those counts on subpages, we gain a lot of useless queries,
improving the loading speed of those sub-pages.

X-original-commit: 79c8384f1bcbcdede030e187008319a70c664571
2020-08-03 07:23:29 +00:00