Commit Graph
121 Commits
Author SHA1 Message Date
Christophe Simonis f36e6917bd [MERGE] forward port branch saas-11.3 up to 37eed7c509 2018-05-29 17:34:43 +02:00
qdp-odoo 01216345e2 [REF] account,payment(_*),sale*: downgrade transactions into debug items
It was very confusing for the user to distinct account.payment and payment.transaction. From now on, the transactions are
technical objects and, in the backend, we only refer to it in log messages (Front end will be adapted in the same fashion
later on). They are hidden in debug mode in accounting\configuration\payments as their purpose is now purely technical/log

This commit also aims to reduce the gap between the accounting app and the transactions: account.payment objects are
created/validated upon completion of transaction.

To ease the capture/voiding of pending transactions, the related buttons are now displayed directly on the SO/invoice
instead of the transactions.

Was task: https://www.odoo.com/web#id=35857&view_type=form&model=project.task&action=333&active_id=967&menu_id=4720
Was PR #24043

[FIX] add domain based on journal to payment tokens

Was opw: https://www.odoo.com/web?debug#id=1828206&view_type=form&model=project.task&menu_id=5200
2018-05-23 15:44:55 +02:00
Christophe Simonis 87e21ccdc5 [MERGE] forward port branch 11.0 up to 521414b1c1 2018-05-02 19:36:16 +02:00
Toufik Benjaa ceeba05d70 [FIX] website_quote: Do not raise exception when quotation viewed
- When a quotation if viewed by a customer, a note is posted in the quotation's chatter saying "Quotation viewed by customer".
  This is causes issues if the quotation is accessed without the access token and by a partner that do not have the rights to write on the model "sale.order".

  To address this issue we provide to the "_message_post_helper" function the sale order's access token to bypass the accesses checks.

  OPW-1839183
2018-04-27 14:15:46 +02:00
len-odoo 0050019390 [FIX] website_sale, website_quote: display payment acquirers per country
Commit 542201eed3 added the possibility to configure a set of countries for a
given payment acquirer.
Commit 194d52e8fd refactored the payment form, but forgot to take the country
into acount.

opw 1837819
2018-04-27 08:23:25 +02:00
Christophe Simonis cdbee48888 [MERGE] forward port branch 11.0 up to 39d9c362c5 2018-03-22 20:05:14 +01:00
Toufik Benjaa 3c2876f689 [FIX] website_quote: Fix '/my/orders' route inheritance
- The module 'website_quote' inherit the CustomerPortal class defined in 'portal/controllers/portal.py'.
It does this to override a single method, namely 'portal_order_page'.
The issue here is that 'portal_order_page' is not defined in the module portal, but in sale.
This causes random issues where the inheritance was not done in the correct order.
Which means the original portal_order_page was sometimes called before its child.
Calling the original portal_order_page first means the child is never called.

This commit change the imported CustomerPortal class to the one defined in the module sale.
2018-03-22 13:51:53 +01:00
Christophe Simonis 36945a5853 [MERGE] forward port branch 11.0 up to c2e878e34c 2018-03-01 19:43:25 +01:00
Nicolas Martinelli 9dfe2ef391 [FIX] website_quote: view quote
- Create 2 SO for the same customer
- Send them
- As the customer, click on 'Accept and sign online' for both quotes.

The message 'Quotation viewed by customer' is only posted on the first
quote.

opw-1815082
2018-03-01 13:41:30 +01:00
Christophe Simonis cb50970f3f [MERGE] forward port branch 11.0 up to eefe879a37 2018-01-25 15:41:45 +01:00
fda-odoo f62b31caf3 [FIX/IMP] account,account_payment,sale,sale_payment: add a payment notification message for user who are coming back in Odoo after a payment (like in online quotations & e-commerce)
WARNING: To avoid breaking any configuration in stable (11.0), the template payment_confirmation_status has been replicated in each module.
They must be removed before a forward-port in master
2018-01-24 15:30:59 +01:00
tbe-odoo 477d28644b [IMP] website_sale/quote: Remove unused code 2017-12-01 10:06:30 +01:00
tbe-odoo e51fa63bda [FIX] website_quote: Do not generate invoices twice
- When paying with stripe an error occurs because of a callback generating the invoice for the SO which is called now automatically by the payment system
2017-10-27 11:45:50 +02:00
tbe-odoo 7c639be4aa [FIX] payment_stripe: fix stripe payment form
- Before this patch, stripe doesn't get displayed.
    It was a bug related to the fact that stripe doesn't respect how the generic payment form works.
    So to make it work, we were relying on small hacks that got broke by changes on the payment form.
    To fix the bug we are no longer adding an event to the pay button of the payment form, instead
    we listen all the changes made to the DOM and detect if a form with an attribute 'provider' set to
    'stripe' is added.
    If so, we open up the Stripe payment form.
- Fix ACL issue when trying to pay with Stripe on eCommerce without being logged.

Closes #20202
opw-776200
2017-10-27 11:45:25 +02:00
rde f435267680 [FIX] website_quote: missing args on route throwing error
Before this commit, trying to pay a sale order from portal would throw an
error

 * create an order in back end, set a partner, a product, a quotation
   template and 'Online Payment' as Confirmation Mode;
 * confirm the order;
 * go to the order in portal (/quote/XX) and click on 'Pay Now';

It throws a server error because route is being called with unexpected
keyword arguments like success_url, error_url, callback_method.
2017-10-26 12:54:38 +02:00
Jérome Maes 932c0d2301 [FIX] website_quote: allow to sign quotation even when customer portal is not configured 2017-09-27 17:32:59 +02:00
Olivier Dony bb0404ea30 [IMP] website_mail: simplify helpers for external post
After removing the `sha_in` params a while ago, we get rid of
the deprecated `token_field` option.

- Make `token_field` a model attribute, so that each model can easily
  define the token field that should be used, and it does not need
  to be passed around all the time anymore.

- Rename `_special_access_object()` to `_has_token_access()`, much more
  readable since it returns a bool

- Do not forward the `attachment_ids` keyword arg to message_post,
  as it sometimes contains unrelated IDs (the helper is not meant
  to post attachments anyway)

- Update callers accordingly
2017-09-21 23:42:45 +02:00
Thibault Delavallée 010960d5e8 [FIX] sale_payment, website_(quote/sale): fix method typo
sale_payment method to check or create a new transaction when paying
a sale order should be named _check_or_create_sale_tx and kept private
like account_payment one. Both versions exists. This commit fixes
the typo.
2017-09-07 18:25:35 +02:00
Thibault Delavallée faea658382 [IMP] website_quote: use generic portal signature widget
Online quote can now use the generic signature widget already used on
the standard sale customer portal. We therefore remove the custom
widget build in website_quote.

A route already exists to sign quotes; the old route is removed. The
existing route is overridden so that quotations with template requiring
payment cannot be signed. This is the expected behavior.
2017-09-06 10:40:32 +02:00
Thibault Delavallée 22734f47d8 [IMP] website_quote: improve quote url management in customer portal
* website_quote should not override all sale links from the customer
   portal to replace them by website_quote specific view. Indeed the
   quote view should be used only if the order has an active template
   defined on it;
 * do not override existing columns of the order page view on portal
   with same content;
 * implement redirection at route level by overriding the
   controller order route;
2017-09-06 10:40:22 +02:00
tbe-odoo 2a2a1c7b28 [IMP] payment,website_sale/quote: Renaming a field and labels 2017-08-29 17:16:42 +02:00
tbe-odoo ea8b189029 [IMP] website_sale: Removing dead code 2017-08-29 17:16:42 +02:00
tbe-odoo 6b38cd8b85 [IMP] payment: UI changes & Fix 500 errors
- Fixed 500 errors when trying to display payment form because of variables partner_id/acquirer_id missing.
- Accepted credit cards are now display next to the acquirer name on the payment form
2017-08-29 17:13:58 +02:00
tbe-odoo 5882cacb90 [FIX] payment: Some input were not set
- e-commerce and website_quote create a transaction with its reference when the user click on Pay.
So we need to render the inputs when the user click on pay and submit the form with the values
2017-08-29 17:13:15 +02:00
tbe-odoo 11bc680ae9 [IMP] payment: Remove ugly render() hack
- Removed an ugly hack that renders s2s forms then display them using t-raw, we're now providing the xml_id of the s2s forms and uses t-call instead.
2017-08-29 17:11:23 +02:00
tbe-odoo 194d52e8fd [IMP] website_quote/sale,payment: Support of the new payment form
- Online quotation and e-commerce now use the new payment form.
- Added the ability to chose on an acquirer if it uses only form/s2s or both.
(Still need some code cleaning)
2017-08-29 17:11:23 +02:00
Christophe Simonis 017ee5eab3 [MERGE] forward port branch saas-17 up to 877e709871 2017-08-24 13:17:53 +02:00
Xavier Morel 3824b5dcc1 [FIX] P3: fix base64 and StringIO uses
* StringIO removed from stdlib, replace with io
* try to correctly handle BytesIO/StringIO (one is for bytes the other
  is for text)
* fix base64: Python 3 removed bytes-encoding and bytes-bytes
  codecs (via #encode) so replace all calls to str.encode('base64'),
  also b64encode is a bytes->bytes conversion so attempt to properly
  handle that

issue #8530
2017-08-20 23:25:54 +02:00
Jérome Maes 3cfd64f63f [MOV] portal,website_mail: move chatter frontend to portal
This split responsiblilies :
- portal provides basic chatter for portal document, and
website documents (slides, blog, ...).
- website_mail provides comments moderation (unpublished mail
message)
- website_rating integrate rating when posting comments
2017-08-16 14:56:40 +02:00
Thibault Delavallée ea27c1b7a3 [MOV] website_portal, portal: move customer portal to portal module
This commit moves the whole customer portal to the portal module.
It now completely uses portal and http_routing features and is not
dependent on website anymore.

An override of web controller is added in portal in order to redirect
portal users to /my instead of /web. That way once having the customer
portal installed all share users are correctly redirected to their
account.

All modules defining customer portal templates and controllers are
updated accordingly.
2017-08-08 14:58:49 +02:00
Denis Vermylen 505686ea4f [IMP] website_portal,*: clean breadcrumbs
We make the breadcrumbs of the portal uniform and remove them when we
access the document with an access token without being logged in
(for sales orders).
2017-07-06 12:53:39 +02:00
Thibault Delavallée ef2d828463 [REF] website_quote: use new sale_payment module
Online quote now uses JS code from payment module in order to make online
payments. Front-end template is updated to use o_payment_acquirer_button
generic class for payments and data is added to be managed by payment.js.
This allows to remove some strange code parsing the url to find the order
ID and token instead of using rendered values.

A payment controller is removed because it was only a shortcut to another
one. In transaction controller token parameter is renamed to access_token
to avoid confusion with payment token and match the payment and website
sale naming.

Online Quote controller now uses tools method from sale_payment module
like website_sale. This way it is now standardized and moved out of
controllers that should not perform so much model-level computation.
2017-06-06 11:05:25 +02:00
Thibault Delavallée 8911be11d1 [MOV][ADD] sale_payment: bridge module between sales and payment
Move sale and payment bridge code into its own module. This commit mainly
moves (and reorganizes without changes) code from website_sale related
to payment and SO confirmation.

Only change is that payment_acquirer_id field on sale order is now a
related on transaction.acquirer_id . Indeed in website_sale and
website_quote both values were written but only managing transactions
and getting its acquirer is more efficient and ensure values are coherent.

JS part controlling payment form management is moved directly into
payment to reuse later on in future commits. Probably.
2017-06-02 17:30:28 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
Laurent Smet e80238042c [REF] report: remove the report module
The content of the report module is now dispatched in
the 'base' and the 'web' modules.
2017-05-08 09:23:12 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Jérome Maes ef75f0245f [IMP] website_portal_sale, website_quote: portal access right
Portal has access (read only) to partner, pricelist,
taxes, ... These access were given to display informations
on portal pages. Since, these are not very secure, we
remove the access right.

Some modifications are required to make the portal work again :
- 'sudo' business document before rendering templates. ir.rule
are still apply to filter the documents do display.
For instance, SO total amount is computed using account.tax.
- a related field has been added on SO line to allow portal user
to see the image of the ordered product (on SO frontend view)
- a new controller is created to display invoice PDF (as 'sudo'),
since the rendering of this document required read access to
taxes, payment terms, ...
2017-03-23 14:51:00 +01:00
Atul Patel ba73069ffe [FIX] website_quote: fix access rights issue when quotation is viewed by customer 2017-03-23 13:28:02 +01:00
Mehul Patel 097aa24566 [IMP] website_quote: fix behavior of Quotation viewed by Customer
Currently when the salesman clicks on 'Preview' button of quotation it
is set as 'Viewed by Customer'. This commit improves this behavior by
ensuring it is triggered only by shared users.
2017-03-23 13:28:02 +01:00
Jeremy Kersten 83bfdb0d21 [IMP] website_portal*, website_project*, website_quote, website_blog: add record pager in portal
+ fix re-use websitue_url in get_access_action
2017-02-24 08:51:26 +01:00
Thibault Delavallée cf1df16aea [IMP] payment_*, website_quote: change callback_eval string to parameters
callback_eval is currently a code string that is evaluated directly
at payment confirmation. This commit changes it to have parameters
on the record and method to call on it. Moreover a hash done once at
transaction creation ensure that a modified transaction does not allow
to execute code on other records.
2017-02-13 16:58:47 +01:00
Nicolas Martinelli 9010ed0a35 [FIX] payment_stripe, website_quote, website_sale: update SO
A side effect of commit b9d1239eff if that the method `sale_get_order`,
which is used to retrieve the SO, will also update information on this
SO (change partner, change pricelist...). We therefore need another way
to retrieve the SO.

opw-692919
2016-11-03 12:03:22 +01:00
Nicolas Martinelli b9d1239eff [FIX] website_quote: set SO id in request
When a quotation is opened from the frontend, set the SO id in the
request. This is necessary in the following use case:
- Receive a website quote
- Pay thanks to Stripe

After commit da82a6b705, we call the route
`/shop/payment/transaction/` manually. However, this route expects to
retrieve the SO id thanks to a call to `sale_get_order`. Since we are
not going through the webshop and the user might not be connected, the
method is unable to retrieve the SO id.

opw-692341
2016-10-28 11:20:00 +02:00
Damien Bouvy 4b831fb4b9 [FIX] website_quote: browse acquirer with sudo in all cases
Somehow in the migration to the new api, it was decided that the
acquirers would be browser as sudo only for token access. This caused
portal users to have a crash when trying to view their quotation since
some fields from acquirers are set the specific groups for security.

This commit reintroduces the old behaviour, which was to browse as
SUPERUSER in all cases for the rendering of the buttons.
2016-10-05 22:31:11 +02:00
Christophe Simonis c813dbf068 [MERGE] forward port branch saas-12 up to 84429ab 2016-09-30 17:21:34 +02:00
Christophe Simonis 84429ab984 [MERGE] forward port branch saas-11 up to 9048865 2016-09-30 16:07:07 +02:00
Christophe Simonis 9048865f23 [MERGE] forward port branch 9.0 up to da388aa 2016-09-30 15:49:02 +02:00
Denis Ledoux dd28f9bf78 [FIX] website_quote: /quote/ redirects to login when not signed in and no token
When the route /quote/<order_id>
is accessed without token
e.g. through the `View sales Order` button
in the headers of thread mails

the user must be redirected to the login screen
if he's not signed in.

In other words, you must be signed in to access
this route without token.

opw-687931
2016-09-29 15:06:38 +02:00
Damien Bouvy 03e2f70c32 [FIX] website_quote: stop usnig recordset in write
and use its id instead
2016-09-22 13:48:20 +02:00
Christophe Simonis 10cde43fd4 [MERGE] forward port branch saas-11 up to 4c2b536 2016-09-16 10:34:39 +02:00