Commit Graph
521 Commits
Author SHA1 Message Date
Christophe Matthieu 7ede9bcb2d [IMP] base ir.qweb: compile template (and use ast) to improve rendering speed
* The compiled templates are cached per user, lang, inherit context values
* ir.ui.fields: attributes method return an dict, and record_to_html return only the content value of the field
* all rendered text use build_text and all attributes use build_attribute
* t-esc-options is removed and replace by format_value method
* AssetsBundle receive the list files and remains
2016-06-14 09:46:25 +02:00
Christophe Simonis ac5023060c [MERGE] forward port of branch saas-10 up to 2f948c7 2016-06-08 12:19:23 +02:00
Christophe Simonis 928bc262a6 [MERGE] forward port of branch saas-6 up to 589751c 2016-06-02 14:26:19 +02:00
Christophe Simonis 589751ca28 [MERGE] forward port of branch 8.0 up to bde083a 2016-06-02 12:58:48 +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
Christophe Simonis 05bbcd6bf9 [FIX] website_sale: correct errors introduced by previous forward-port 2016-05-04 18:31:56 +02:00
Christophe Simonis 70842689a0 [FIX] base,website_sale: correct errors introduced by previous forward-port 2016-05-04 17:42:38 +02:00
Christophe Simonis 0fbc92e0c4 [MERGE] forward port of branch saas-10 up to 1e86774 2016-05-04 17:09:51 +02:00
Nicolas Martinelli 740d67a089 [FIX] website_sale: set invoice address
When the user has several addresses, the call to the onchange method
`onchange_partner_id` will overwrite the actual invoice address chosen.

opw-675935
2016-05-02 13:00:34 +02:00
Christophe Simonis 7f9a973f51 [MERGE] forward port of branch saas-6 up to f811fff 2016-04-26 15:43:08 +02:00
Christophe Simonis f811fffbbe [MERGE] forward port of branch 8.0 up to 7e51d98 2016-04-26 15:15:22 +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
Christophe Simonis 6c8141a1df [MERGE] forward port of branch saas-10 up to 2483327 2016-04-01 16:15:35 +02:00
Denis Ledoux 69fa2d5662 [MERGE] forward port of branch saas-6 up to 8f1782b 2016-03-30 11:23:18 +02:00
Denis Ledoux 8f1782bd05 [MERGE] forward port of branch 8.0 up to 1d5db336 2016-03-30 11:08:57 +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
Christophe Simonis de8e9a0f96 [MERGE] forward port of branch saas-6 up to 348e8a9 2016-03-23 15:55:34 +01:00
Christophe Simonis 348e8a9d83 [MERGE] forward port of branch 8.0 up to 9752aed 2016-03-23 15:49:27 +01: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 15f27b2614 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
Denis Ledoux 15f27b2614 [FIX] website_sale: always re-render the pay now button
Before this revision,
when a user tried to pay his cart with a first acquirer
e.g. Ogone
then came back to the shop (using the browser back button)
then chose another acquirer
e.g. Paypal
a new transaction is created, due to the change of acquirer
(following revision cb9d798)
and therefore, the transaction has a new reference compared
to the last payment transaction attempt (e.g. the ogone one)
but, the old reference is still referenced within
the `Pay now` form values, because the page wasn't re-rendered,
because the user pressed the browser back button, and this
doesn't refresh/re-render the page, and, therefore,
the old reference was still referenced within the `Pay Now`
form values.

Therefore, the wrong reference was sent to the acquirer
(e.g. paypal) and this prevented the payment validation
at the payment feedback, as the new reference was expected
in the feedback information, while we receive the older one.

This revision makes sure to always re-render the `Pay now`
form, so the transaction reference, as well as the other
possible changes in the values, are correctly set,
before sending the information to the acquirer.
2016-03-21 10:30:03 +01:00
Ravi Gadhia 788c1334e2 [IMP] website_sale: migration to new api 2016-03-17 17:26:52 +01:00
Martin Trigaux 2c904509a3 [IMP] website_sale: cleaning of outdated code
- remove field complete_name
  is the same as the ORM field display_name, compute the name_get

- website_publish_button is duplicated
- write outdated, according to TODO (field color already renamed)
- Instead of open_website_url, should use website_publish_button
- styles, style_in_product, attrib_encode: are no longer used in templates

- remove unnecessary rebrowse
  This check was added at d3678bf5 either
  - to prevent browsing as public user (wrong as always browsed with SUPERUSER_ID)
  - to refresh fields of the record (I find your lack of faith in the cache
  invalidation distrubing)

- remove get_pricelist method
  equivalent to call request.website.get_current_pricelist
2016-03-17 17:26:38 +01:00
Martin Trigaux a1339c5aad [IMP] website_sale: propagate modified context only in useful methods
The pricelist in the context is only useful when computing the price of the
product.
Do not modifiy request context but only a local copy.

active_id is only used for the computation of the extra price from variants
2016-03-17 17:18:55 +01:00
Denis Ledoux af174897ab [FIX] website_sale, website_sale_options: currencies
Adaptations following rev. 1684ae4:
    The website pricelist is now dynamic, according
    to the pricelist chosen by the customer on the website.
    It's no longer a static pricelist, it's no longer
    the public user pricelist.

    Therefore, when computing the variants prices,
    the prices should no longer be converted
    from the public user pricelist to the current (context)
    pricelist, but from the product currency to the
    current pricelist chosen by the customer on the website

    In addition, when getting the unit price,
    `/shop/get_unit_price`,
    the website current pricelist should always be used,
    it should never fall back on the partner pricelist,
    as, it's the user who choose his pricelist from the website
    now (if he has specific set on his partner
    form, it's that one which is loaded by default, and which
    is returned by the website.pricelist_id)

    In addition, the displayed currency on the ecommerce
    must always be the current website pricelist currency

Adaptations following rev. 3622c0d:
    A product can have no company set (not required).
    Therefore, when attempting to set the `from_currency`
    to the product company currency, this could return
    `None`, if no company was set on the product.
    `product.currency_id` ensures to always return a currency
    for the product. It's the company currency
    if the product has a company set, otherwise it take it from
    the main company (`base.main_company`).

    In addition, when editing the product price from the website,
    the price must be displayed within the product currency,
    as, if changed by the user, it changes the product sales
    price directly on the product form, without any currency
    conversion applied or whatever.

opw-670898
opw-671100
2016-03-04 16:34:17 +01:00
Denis Ledoux 22830251c7 [FIX] website_sale: avoid to set no shipping address
This is related to the revision e673ee6c62.

The checkout shipping address must be written on the
sale order only if there is one.
2016-02-18 14:42:43 +01:00
Denis Ledoux e673ee6c62 [FIX] website_sale: checkout change of delivery address
If a customer had several delivery address,
and at checkout, choose another one than the default one,
his choice was applied, the delivery address remained the default
one.

This is a regression in Odoo 9.0 introduced in revision:
0414c9d.

The checkout shipping was applied only when it was a new
delivey address, due to the identation.

Part of the indentation issue was solved in 0f25a8c

opw-669787
2016-02-18 12:23:18 +01:00
Olivier Dony 93e8bf8ccf [MERGE] Forward-port saas-6 up to 1f022a0b4a 2016-02-03 16:55:41 +01:00
Olivier Dony 1f022a0b4a [MERGE] Forward-port 8.0 up to rev. 67a63e2cc9 2016-02-03 16:53:30 +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
Nicolas Martinelli 2d4257da1a [FIX] payment_authorize: send billing and shipping data
Authorize.net requires both billing and shipping data.

opw-660771
2016-01-20 15:48:31 +01:00
Olivier Dony fca0714119 [FIX] website_sale: ean13 was renamed to barcode as of saas-6 2016-01-14 11:55:44 +01:00
Ajay Javiya 6006c0d72a [FIX] on website sale checkout once create address and confirm order , after that if user change it to ship to same address still ship address is set previousely create address 2016-01-13 19:34:36 +01:00
Christophe Matthieu a830263992 [FIX] wesbite_sale: recompute taxes only when update checkout
Issue: We force to recompute the taxes on all lines in constrains. This forcing loose custom added taxes in the backend.
2016-01-12 15:01:08 +01:00
Christophe Simonis 499c2b8da5 [MERGE] forward port of branch saas-6 up to 580389a 2016-01-08 18:26:59 +01:00
Denis Ledoux ff72139aff [FIX] website_sale, website_quote: pay now confirmation email
When configuring the payment acquirer with the confirmation
`at_pay_now`, meaning the sale order has to be
confirmed when clicking on the "Pay now" button, instead
of waiting for the payment confirmation,
the confirmation email wasn't not sent.

opw-665697
2016-01-07 13:52:07 +01:00
Denis Ledoux cb9d7982c1 [FIX] payment, website_sale: condition to recreate a payment transaction
Before this revision, in the ecommerce,
a new payment transaction was created only
when the transaction reference was different than
the order number, meaning that the transaction id
in the user session no longer refers to the current order,
that the user created a new order which has nothing
to do with the transaction he has in his session
variable `sale_transaction_id`

This made sense when the transaction reference
strictly matched the order number, but,
since f89e8f9df2,
this is possible that a payment transaction reference
number no longer strictly matches its order number,
as the transaction reference can contain `-1`, `-2`
at the end of its reference, meaning there was
already another transaction existing with the sale
order number as reference. But the transaction
is still about this order.

Therefore, from this revision, the condition on
which a new transaction has to be created
should no longer be based on the transaction
reference, but to which `sale_order_id` the transaction belongs.

In addition, we add two more conditions for which a new transaction
should be created:
 - The transaction has been cancelled or in error
 - The acquirer has changed.

For the second case, this is to handle a corner case:
 - The user selects one payment acquirer (Ogone), then click
   on "Pay now", and is therefore redirected to the payment provider website (Ogone)
 - Then, the user opens a new browser tab on the ecommerce, on his cart,
   choose another payment provider (Paypal), then click "Pay now" and is
   redirected to this second payment provider website  (Paypal),
 - Then, the user comes back on the first tab, on which he is on the first
   provider website (ogone), and pays/validate the payment
 - Then, we receive the payment feedback (either from the user/DPN, either from
   the server to server call/IPN)

Before this revision, this use case would have lead to the feedback from the first
provider (`/payment/ogone/accept`) while the transaction is set with the second
payment provider (`Paypal`), therefore breaking the payment validation.

Creating a new transaction when the user changes of payment provider solves this issue.
He will nevertheless be able to pay twice, on each provider, but it was
already the case before.

opw-659294
2015-12-15 18:31:12 +01:00
Jeremy Kersten 0f25a8ce1d [FIX] wesbite_sale: recompute taxes when fiscal position is updated
We force to recompute the taxes on all lines when we change the fiscal position.
That was already done in backend, with the onchange.
But @api.contrains allow to do it on each write on fiscal_position_id field.

@api.Depends will not work because it is not a computed field.
2015-12-11 10:09:52 +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
Jeremy Kersten 96d316fdf4 [FIX] website_sale: recompute fiscal position at checkout
Method refactored by commit 94716a3 and 198164d
2015-12-09 13:38:55 +01:00
Nicolas Lempereur 4e0821ae9a [FIX] website_sale: attribute selection unreversible
On a list of product, the attribue list (can be activated via the
customize menu) only contains the attribute pertaining to current
filtered product list.

Also, all the values of a the attribute are showed, even if choosing a
value will result in an empty product list.

It could lead to usability issue in some situations.

e.g

1) the current showed products number 2 with an attribute color,
2) we select "Red" which isn't a value these 2 products are declined in,
3) the current show products is now empty, but we can't un-select the
   "Red" color since "Color" is not an attribute of any of those 0
   product.

This commit solves this issue by displaying the currently selected
attributes if no product is displayed.

opw-653594
2015-11-05 10:32:02 +01:00
Nicolas Martinelli affce2c49c [FIX] account, website_sale: do not set fpos on res.partner automatically
When a partner is created, the fiscal position is set automatically if
possible. This is not correct, the fiscal position should only be set
automatically on a SO, based on the delivery address.

Here is a scenario explaining the reason:
- Create 2 fiscal positions, one in US and one in Canada. Both fiscal
  positions apply automatically depending on the country.
- As an non-logged user, go in the web shop
- Buy a product
- At the checkout phase, the Billing Information are in US, but the
  Shipping Information in Canada.
- The fiscal position which will apply will be US, while you expect it
  to be Canada

The reason is that the fical position which applies is the one on the
parent partner (US in this case), since all children partners must have
the same accounting data.

With this fix, we simply remove the automatic setting of the fiscal
position on the partner.

opw-653072
2015-11-04 15:08:35 +01:00
Christophe Simonis d750206c49 [MERGE] forward port of branch saas-6 up to e9f1ee4 2015-10-01 15:16:59 +02:00
Christophe Matthieu 66871ee65b [IMP] website_sale: render all order-lines and change cart quantity
* update cart code simplification
* fix rendering bug when change pricelist
* remove get_unit_price and fix rendering error from website_event_sale
2015-10-01 10:26:29 +02:00
Olivier Dony af4a60b941 [MERGE] Forward-port 8.0 up to rev. 26d0fe6d9f 2015-09-30 02:53:59 +02: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
Damien Bouvy 8bc59fe58f [FIX] website_sale: multiple fixes
- fixes product ordering in shop page
- fixes "sale" ribbon that was un-removable
2015-09-24 11:50:24 +02:00
Christophe Simonis f8b4a5e2fe [FIX] website_sale: ean13 product field has been renamed barcode 2015-09-23 17:54:42 +02:00