Commit Graph

406 Commits

Author SHA1 Message Date
Jeremy Kersten f1a331850d [FIX] website_sale: fix order for the pager in front end.
In psql, use LIMIT and OFFSET together without a fully specified and uniq sort order
will generate unexpected behaviour.

Eg:
> id   id_dept  name
> -------------------
> 1    1        Tom
> 2    1        Mike
> 3    2        Meggie
> 4    2        Marge
> 5    3        Bart
> 6    3        Lisa

> using LIMITed selects like:

>    SELECT * FROM employee ORDER BY id_dept LIMIT 3
>    SELECT * FROM employee ORDER BY id_dept LIMIT 3 OFFSET 3
>    SELECT * FROM employee ORDER BY id_dept LIMIT 3 OFFSET 6

> You can have some result missings from the 3 requests, and others duplicated.
> Because id_dept is not a uniq order.

opw-686639

note: backport of saas-12 4dce8616
2016-08-29 17:08:25 +02:00
Nicolas Martinelli 6817c48a8b [FIX] website_sale: check email address
Partial backport of ef19830. The error message cannot be included for
compatibility reason, but the browser will highlight the field in red,
which should be enough to locate the error.

opw-677121
2016-06-13 14:08:26 +02:00
Jeremy Kersten 2164383fe4 [FIX] website_sale: allow to override product order on shop
Close #11202
2016-05-27 11:56:35 +02:00
Nicolas Martinelli f5eae92f12 [FIX] website_sale: log if no pricelist
The pricelist field is not a mandatory field on the partner. A default
value is usually defined for any new partner created. However, if the
pricelist is manually removed from the partner, errors (tracebacks) will
occur in the eCommerce when no pricelist is found.

We cannot make the field mandatory, as it could potentially break the
workflow of some users which are not using eCommerce. Therefore, we
simply log an error message to help debugging.

opw-673453
2016-04-26 10:14:56 +02:00
Denis Ledoux 1d5db33638 [FIX] website_sale: perform onchange as sudo
This revision is related to 9752aedb4e

It looks like in some cases, the user cannot read the
partner associated to his own cart.

This is the case when shopping without being signed in.

opw-673187
2016-03-30 11:06:08 +02:00
Denis Ledoux 9752aedb4e [FIX] website_sale: update partner details when reusing payment transaction
When attempting to pay a cart in the ecommerce,
if the customer went on the payment acquirer site
(meaning, the `payment.transaction` is created
in the database), then come back to the checkout form
using the browser back button, and changed his customer
details (address, email, phone,...),
these changes in the details were not applied
in the `payment.transaction` record that was being
re-used.

e.g.
Checkout > Confirm > Choose Paypal, Pay Now
> History back to the checkout and apply changes
in the address > Confirm > Pay Now.
2016-03-23 15:38:20 +01:00
Denis Ledoux a0c473379a [FIX] website_sale: back port of 15f27b2614a4d6f86ded20fc7b3d8e796a2db078 2016-03-23 15:38:20 +01:00
Denis Ledoux a430e2c8c5 [FIX] payment, website_sale: back port of cb9d798 2016-03-23 15:38:19 +01:00
Denis Ledoux e1b1f24516 [FIX] payment, website_sale: back port of f89e8f9 2016-03-23 15:38:19 +01:00
Martin Trigaux aca28c82b4 [FIX] website_sale: do not compute price of every pricelist
This controller was very slow as not providing a pricelist computed the price of
all products of all pricelists.
Instead only fetch the prices for the useful products.
2016-02-03 12:05:42 +01:00
Christophe Matthieu 267ab22d00 [FIX] website_sale: variable reference
'message' variable was not always defined.
Set a default value.
Closes #10006
2015-12-10 14:17:03 +01:00
Denis Ledoux 2d3e9d21a7 [FIX] website_sale: ensure payment transaction is for current order
When ordering on the ecommerce,
if a payment transaction was found in the session,
this transaction was used as transaction for the current order.

Nevertheless, if the transction is no longer linked to
the current order, we should not use it.

This happened, for example, when the quotation
was deleted while the customer/user didn't close
its browser, and the transaction id was therefore
still in its session.

opw-650417
2015-09-29 12:10:04 +02:00
Wolfgang Taferner 4f41c3327c [FIX] website_sale: make checkout fields customizable
[FIX] Valuable checkout hooks for website_sale
[FIX] Values might need to be changed for different field mappings
[FIX] Make definition of form fields inheritable within a function
[FIX] Make shipping_info values available for inherited module manipulation

Close #8490
2015-09-18 21:17:51 +02:00
Wolfgang Taferner b89b7e0554 [FIX] website_sale, website_sale_delivery: Improve GA eCommerce data
As eCommerce is not complete and could be improved easily and was
not working anyway until
9d0cb024fd

- Use EAN13 instead of internal product id if available
- Add tax to transaction data
- Add shipping costs if available to transaction data
2015-09-08 18:06:38 +02:00
Nicolas Seinlet 9c8b99acf7 [IMP] website_sale: extract search domain in overwritable method 2015-09-04 17:26:06 +02:00
Denis Ledoux 9b489e9d7c [FIX] website_sale: deleted category on website product page
Product pages ulrs can be indexed by searches engines.
The product category can be included in the url.
If the category has been deleted, accessing
this page should still work anyway

opw-648008
2015-08-26 11:10:22 +02:00
Goffin Simon 9fed748647 [FIX] website_sale: error in message
Error introduced by 4f91dc371c
2015-08-13 09:03:30 +02:00
Denis Ledoux 31ffd010b1 [FIX] website_sale: flag partners as customers
When placing an order in the ecommerce, it's
seems obvious that the partner is a customer.

Nevertheless, It wasn't flagged as such in
its partner from, preventing
to see him in the customers list

Fixes #2422
Closes #2881
2015-08-12 16:39:46 +02:00
Goffin Simon 4f91dc371c [FIX] website_sale: transaction error
When an error occurs during the transaction, the customer must receive
a message to inform him.

opw:645705
2015-08-05 15:19:45 +02:00
Goffin Simon b654a33a13 [FIX] website_sale: previous with adyen
When clicking on previous in Adyen payment, the customer will be
redirected in the shop and not in the confirmation page.

opw:645705
2015-07-31 10:20:45 +02:00
Nicolas Lempereur b8f9ca4027 [IMP] website_sale: clear promo pricelist when cart empty
opw-646221
2015-07-29 14:38:23 +02:00
Denis Ledoux 4adb4b8d15 [FIX] sale, website_sale: Send email on sale order confirmation
Not just when coming back from the payment provider to the
payment validation route `/shop/payment/validate`.

Otherwise, if you do not come back from the payment provider
page, that you quit just after having paid but just before
being redirected to Odoo, you do not receive the email.

The change within the `sale` module, while this issue concerns
`website_sale` only, has been accepted because this is a mechanism
that could be used by other modules.

opw-644348
2015-07-09 15:51:50 +02:00
Jeremy Kersten 02d3e703a2 [FIX] website_sale: fix ga Ecommerce statistics
Name from product was missing / confusing with category name
https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiEcommerce
2015-06-30 09:44:01 +02:00
Goffin Simon d3711f2cab [FIX] website_sale: existing transaction
If the transaction already exists, the amount total of the transaction must
be updated.
The case occured when:
[1] you put a product A in the cart
[2] click on "Process Checkout" and click "Confirm"
[3] select Adyen or Paypal as payment method
[4] click on "Pay Now"
[5] return in the cart instead of paying your order
[6] add a product B in the cart
[7] click on "Process Checkout" and click "Confirm"
[8] select Adyen or Paypal as payment method
[9] click on "Pay Now"
Now check the transaction payment linked to the order in backend, the total amount of the order is equal
to price A + price B and the total amount of the transaction payment is equal to price A.
This commit solves this problem.
opw:634119
2015-06-18 16:24:14 +02:00
Nicolas Lempereur 3f1e99c4b9 [FIX] web, website_form_website_sale: form and login
Partial backport of commit 093e39bd.

When a flow is stopped by a login redirection, some data (e.g: a product
comment being posted) could be lost. This commit in this case convert
POST request data to GET data (so it is possible to add a GET controller
which after login will terminate the action).

closes #7100
opw-642350
2015-06-17 11:33:20 +02:00
nafex f5585731f4 [FIX] website_sale: allow to reset field
When filling the form (for invoice or delivery details), once a field has been
filled, it's no longer possible to remove the value of this field.
e.g. set a company, not possible to remove it when modifies the address

This is due to the `get(key)` call that is considered as False with empty
strings. Instead, check the existance of the key.
Still not accepting mandatory in the form (not checked in this method).

Fixes #7017
2015-06-12 09:37:45 +02:00
Nicolas Martinelli f6c65a3d9e [FIX] website_sale: prevents the modification of a SO line if SO is not 'draft'
opw-634681
2015-05-18 13:08:01 +02:00
Goffin Simon bff6dffbb4 [FIX] website_sale: Coupon Code
The pricelist linked to the coupon code is just applied in the cart.
In the shop, the pricelist of the user is applied.

opw:634639
2015-05-11 14:25:11 +02:00
Goffin Simon 08d69774b0 [FIX] website_sale: Pricelist witn min qty
Each time a product is added in the cart, the qty of this product must be checked to
adjust the price if there is a rule (with min qty) in the partner's pricelist.

opw:630049
2015-04-10 10:57:37 +02:00
Denis Ledoux c3f4ec856c [FIX] website_sale: keep attributes filter in pager
While having a product list with 20+ products,
If more than two attributes were set in the shop filter,
going to the next page kept only the first filter.

opw-629188
2015-03-02 16:44:24 +01:00
Denis Ledoux e1a1b56205 [FIX] website_sale: handle partner_ids for order email confirmation
This rev. is related to b36908b6f8

partner_ids is another *2many fields of email.template
spotted thanks to ba9bc1e86d
2015-02-05 14:14:30 +01:00
Denis Ledoux b36908b6f8 [FIX] websiste_sale: order confirmation email with attachment
This rev. is related to 67443b5b17

onchange_template_id returns the attachment_ids as a id list,
not as a *2many command list
The conversion from id list to command list has to be done manually.

At the moment, attachment_ids is the only 2many fields of email.template
2015-02-04 17:08:58 +01:00
Olivier Dony c18a7eb82a [FIX] website_sale: visible attributes wrongly computed for some variants
On one hand, when a product attribute is shared by several
products, some may use different subsets of its possible values.

On the other hand, when less than 2 values are enabled for
a given attribute on a product, no choice is displayed for
that attribute on the shop page, as there is none to be made.

The way those "visible attributes" were computed in
get_attribute_values() was wrong: when counting the
number of values it used the whole range of possible
values for this attribute (cross-product), not just
those enabled for that product.

This lead to inconsistencies vs the website_sale.variants
template, and products using a single value out of a larger
range of values were constantly marked as "Not available"
in the shop.
2015-01-30 19:45:14 +01:00
Denis Ledoux 67443b5b17 [FIX] website_sale: use email template email from for confirmation email
The email_from for the order confirmation email in the ecommerce
was forced to the company email,
preventing any customisation concerning the from email address
in the sale order mail template.
2015-01-30 13:11:15 +01:00
Nicolas Seinlet 1eb2507034 [IMP] improve search in webshop using a split on white spaces 2015-01-07 15:43:03 +01:00
Christophe Matthieu 6471fa6ddb [FIX] website_sale: Discussion not working on product and gives '500: Internal Server Error' if public user try to comment on product (without login). Need to redirect to the login page (all user who want to write a comment have already buy the product and can use the portal login) 2015-01-05 13:30:36 +01:00
FalcoBolger c0dce6ac1e [FIX] website_sale perfomance on public categories
Use a domain instead of python filtering when loading root categories.

Closes #4324
2014-12-19 17:48:50 +01:00
Denis Ledoux cf4c826aa7 [FIX] website_sale: set partner lang according to website lang
On ecommerce checkout, the language of the partner wasn't set according to the language in which he is visiting the website.
Therefore, its partner was set with the default language (English in most cases), and any emails sent to him were not translated in his own language (in the email templates, such as the quotation email he received on order confirmation)
2014-12-08 17:50:34 +01:00
Christophe Matthieu d3c562d4e8 [FIX] product: keep attribute on a variant with only one attribute
When adding informational attribute, with only one possible value, it used to be skipped.
Instead keep it and add it on every variant.

To avoid dropping and recreating product (and lose eventual customisations), the attributes with only one possible value are set on every product.
This makes sure that in following test, these are not considered in variants_inactive variable.

Fixes #3204
2014-11-26 14:35:08 +01:00
Tymoteusz Motylewski 856eba1de0 [IMP] website_sale: performance on category page
public_categ_ids field was moved to product.template object
2014-11-26 12:09:37 +01:00
Jeremy Kersten d978c78246 [FIX] website_sale: browse category to slugify. Because slug of an id will generate a tb 'need more than 1 value to unpack' 2014-11-13 14:48:30 +01:00
Jorge 93e4e7da6e [FIX] website_sale: don't display twice some products
In list view, the 10 last products of a page were the 10 first products of the next page.
Fixes #3373
2014-10-30 12:04:42 +01:00
Simon Lejeune a644bbaec8 [FIX] website_sale: don't apply the company name as street logic in shipping address 2014-10-29 16:06:03 +01:00
Simon Lejeune ced8c3cf3f [FIX] website_sale: remove spurious print 2014-10-29 16:05:50 +01:00
Christophe Matthieu 4a46fce95a [FIX] website_sale: Postal Code is required during checkout for countries without postal codes; Zip must be not required. 2014-10-27 10:24:13 +01:00
Christophe Matthieu 23f9736372 [FIX] website_event_sale: display the discounted price in website.
Add price_reduce compute method on ticket and sale order line
2014-10-24 14:16:16 +02:00
Denis Ledoux 8521e701fa [FIX] website_sale: right number of products in the page
The goal is to fill the page with at least 20 products and to fill all grid lines
Thus, the page should be filled with products until there are 20 products and all lines of the grid are full.
2014-10-23 14:14:50 +02:00
Olivier Dony 9b67a483df [FIX] website_sale: better fiscal position detection + support update during checkout
The customer can change the country and tax
number in the billing information during
checkout, and the taxes should be properly
updated according to the re-detected fiscal
position.

The fiscal position detection also depends
on the `vat_subjected` flag, which we now assume
to be implicit as soon as the customer filled
in a valid Tax Identification Number.
2014-10-10 21:02:33 +02:00
Denis Ledoux 38668fd404 [FIX] website_sale*: handle no delivery methods in website
Display a user friendly message instead of crashing when there is not delivery method available for a specific order
2014-10-08 15:38:16 +02:00
Jeremy Kersten 8ff6299d9d [FIX] website_sale: save the company in street and the street in street2.
The old behaviour was not better, because when we print the invoice, the order was ugly:
    Name
    Street
    Company name
    Country

Now we will have:
    Name
    Company name
    Street
    Country

This patch is not retro-compatible:
   Old partners will see the address in company name and vice-versa.
   Need to update view and switch street field and street2 field
2014-10-07 19:00:45 +02:00