Commit Graph
168 Commits
Author SHA1 Message Date
Nasreddin Boulif (bon) c40aadb42b [FIX] sale,website_sale: Display extra prices with taxes included
Steps to reproduce the issue:

  - Install eCommerce module
  - Go to Settings
  - Ensure `Product Prices` is set to 'Tax included'
  - Create a new Product as storable
  - Set `Sales Price` to $1.0 and `Customer Taxes` to 10.00 %
  - Under `Variants` tab add an Attribute with 2 values
  - Set "Price Extra" to $2.0 to one of the variants
  - Go to the Shop and select the product

Issue:

  The extra price badge does not include the taxes
  ($2.0 instead of $2.2), however the final price does.

Cause:

  The price_extra field from ptav (used in the badge) does not include
  the taxes.
  However, when calculating the final price, we do first the sum of all
  prices (including the extra prices) and then apply the taxes.

Solution:

  In the template, for each 'variants', we call `_get_combination_info`
  to get the variant.price_extra with taxes included/excluded
  depending the `Product Prices` setting.

opw-2669871

closes odoo/odoo#81949

X-original-commit: 6f04935d14d595faa3bb8dd6ba9e0dcf1d694886
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-01-12 10:17:43 +00:00
Romain Derie c88f76cab7 [FIX] website_sale: add missing method check 2021-12-21 17:14:00 +01:00
Yannick Tivisse 9e99a9df46 [IMP] product: Remove price/pricelist_id field from template/variant
Purpose
=======

The fields are not used, don't work correctly and there is a specific
report to generate the product prices according to the pricelist and
the ordered quantities
2021-12-23 15:30:23 +01:00
Yannick Tivisse 5863070066 [IMP] sale: Remove useless SO line values on creation
Purpose
=======

Those are now the default values that are computed from the field
definition.
2021-12-02 12:12:03 +01:00
Yannick Tivisse fecff7119f [IMP] sale: Don't recompute taxes on tax configuration change
This should be done manually
2021-12-02 12:12:02 +01:00
Yannick Tivisse 916e92aa30 [FIX] sale: Split product_id_change into several compute methods 2021-12-02 12:12:02 +01:00
Yannick Tivisse 550eb0b73c [IMP] account: Convert _onchange_sale_tax into compute method 2021-12-02 12:12:01 +01:00
Nasreddin Boulif (bon) ab523354fa [FIX] website_sale: Display pricelist price if no price_unit
Steps to reproduce:

  - Install website_sale module
  - Enable discount and advanced pricelist in settings
  - Create product with sale price 0$ and set a website in
  - eCommerce + publish the product
  - Create pricelist PPP with Discount Policy as
  - "Show public price & discount to the customer" and selectable in the website
  - Go to the product and set an extra price of 10$ for the new pricelist
  - Go to the product in the eshop and select the pricelist PPP
  - Add the product to the shop cart

Issue:

  The price displayed is 0$ instead of 10$.

Cause:

  Since price_unit equal 0$, not possible to calculate the discount and
  therefore using the 0$ value.

Solution:

  Use price of pricelist in case 'discount_policy' is 'without_discount'
  and price_unit equal 0$.

opw-2652192
Forward-Port-Of: #78570

Cherry pick of 32d34ffb04b3c6a8397c8ff7eb4e8a3dd9fb8a95

closes odoo/odoo#78778

X-original-commit: f34e441578bd2ba93dff1feffe6cafee633b9d32
Signed-off-by: bon-odoo <nboulif@users.noreply.github.com>
2021-10-21 15:47:31 +00:00
Romain DerieandTom De Caluwé 78bc86cbec [IMP] website, *: migrate Universal Analytics to Google Analytics 4
*: website_sale, website_sale_delivery

The old analytics snippet (isogram) is replaced by the newer gtags
snippet. Virtual page views and ecommerce transactions are now tracked
using gtags. The e-commerce data format is updated to correspond with
the new GA4 format.

task-2500769

closes odoo/odoo#72233

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Tom De Caluwé <tdc@odoo.com>
2021-09-03 15:45:08 +00:00
Tom De Caluw 046189fb53 [IMP] website_sale: allow hide attributes in filter
task-2466988

closes odoo/odoo#75898

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-09-03 08:12:14 +00:00
Adrien Widart 7d78dd42c0 [FIX] website_sale: compute price with discounts and pricelists
When combining two pricelists, the unit price might be incorrect

To reproduce the error:
1. In Settings, enable:
    - Pricelists (Advanced)
    - Discounts
2. Create a product P:
    - Sales Price: $100
    - Available on website
3. Edit the Public Pricelist:
    - Add a price rule:
        - Apply On product P
        - Min. Quantity: SuperProduct
        - Compute Price: Percentage
        - Percentage Price: 63%
    - Discount Policy: Included in the price
4. Create a second pricelist:
    - Add a price rule:
        - Apply on product P
        - Compute Price: Formula
        - Based on: Other Pricelist
        - Other Pricelist: Public Pricelist
        - Price Discount: 25%
    - E-commerce Promotional Code: PROMO
    - Discount Policy: Show public price & discount
5. On the website, add P to the cart
6. Edit the cart:
    - P's quantity: 500
    - Apply PROMO code

Error: The new price is $75 instead of $27.75

`_website_product_id_change` already returns the correct price value, so
the latter shouldn't be computed again (moreover,
`_fix_tax_included_price_company` should use the price with the pricelists
applied instead of the default product price)

OPW-2605804

closes odoo/odoo#75843

X-original-commit: 030e92a3150bbb7d749f1a6f10e261791da6eca6
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-09-02 03:43:02 +00:00
Jeremy Kersten 268f9ee15a [FIX] website_sale_coupon: fix typo in test
closes odoo/odoo#74270

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-07-26 16:53:19 +00:00
Nicolas (vin) c1693581d7 [IMP] account: payment method improvements
To improve the payment method system, proceed to a few changes
such as changing the view a bit, making sure payment acquirers are not
linked to a journal by default and that only the manual payment method
type can be used multiple times in a single journal.

Task id #2573145

closes odoo/odoo#73596

X-original-commit: 9122b367baea10e59b66e45bf7c458a6f1e82efb
Related: odoo/enterprise#19623
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-07-12 18:10:36 +00:00
Goffin Simon e5658ce529 [FIX] website_sale: Display discounted price with included tax
Steps to reproduce the bug:

- Let's consider a company in $
- Let's consider two sales taxes T1 (10% included) and T2 (0%)
- Define a fiscal position FP that maps T1 to T2
- Define a product P with T1, price = 11$ and available in the shop
- Define a pricelist PL in € such as 1€ = 2$, show discount to customer and discount P with 50%
- Define a portal user PU with FP and PL
- Log with PU
- Add P in the cart

Bug:

The unit price of P was 2,75€ instead of 2,5€ and the discounted price was 10€ instead of 5€

PS: Before adding P in the cart, the correct unit price and discounted price were displayed.

opw:2472528

closes odoo/odoo#69745

X-original-commit: 5e414d80dd5faf0b90d62dbccc1e6237099ac8db
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-27 10:58:15 +00:00
Benjamin Vray 9ea293ae36 [IMP] product, website_sale, *: reword some product names
* = website_sale_comparison

Remove the "(Config)" from Customizable desk and conference chair.

task-2009483
Part of #66736
2021-04-01 14:56:36 +00:00
Goffin Simon 82df79c10c [FIX] website_sale: Wrong price in the shop
Steps to reproduce the issue:

- Let's consider a product P (11€) with a 10% included tax T1
- Let's consider a fiscal position FP that mappes T1 to a tax T2 (0%)
- Let's consider a website that displays prices with tax included
- Let's consider a portal user PU with FP as fiscal postion
- Log with PU
- Go to the shop and filter products to see P

Bug:

The price of P was 11€ instead of 10€

PS: When adding P in the cart, the correct price is displayed.

opw:2472528

closes odoo/odoo#68081

X-original-commit: e7bfadea847012ee956b7bb425688b5f9ccda9cf
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-03-18 12:44:22 +00:00
Romain Derie 07b34a42f1 [FIX] website_sale: add tests to ensure correct fiscal position is used
Forward port of tests only of #64477 (12.0) since the fix was already applied
in 14.0 with https://github.com/odoo/odoo/pull/40336

opw-2423215

closes odoo/odoo#64570

X-original-commit: 2891f9e24f10f42fd997e2f42aee80a53bc6acaa
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2021-01-14 16:51:17 +00:00
Benoit Socias 190eebca44 [FIX] website_sale: use image from first available variant if no default
Before this commit if a product template has no image, no image was
displayed in the website shop for the product

After this commit if a product template has no image, the image of the
first variant is displayed in the website shop

https://github.com/odoo/odoo/issues/52463

closes odoo/odoo#62440

X-original-commit: 643c8a9dce9455fe614f73ed97a793856e3608e7
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-26 16:14:21 +00:00
Benoit Socias a5fc632682 [FIX] website_sale: find abandoned cart using specific delay per website
Before this commit the search for abandoned carts was always using a delay of
one hour if no ebsite in the context.

After this commit the search for abandoned carts uses the specific cart
abandoned delay configured for each website and the related public partner_id.

This commit closes #59709, #54932

closes odoo/odoo#61671

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-11-17 12:49:47 +00:00
Arnaud Joset 44d43ace64 [FIX] sale_product_configurator,website_sale,website_sale_product_configurator: tests were failing
Before this commit,
 * the website_sale tests used the field optional_product_ids on product_template even if it is defined on sale_product_configurator.
 * the website_sale_product_configurator test added some steps to the website_sale tour.

This commit removes the faulty fields in the website_sale test and fix the website_sale_product_configurator tests.
After this commit, sale_product_configurator and website_sale_product_configurator have a test classes to setup all the parameters needed during the flow.
This prevent duplicated code for similar workflow.

closes odoo/odoo#60081

Taskid: 2340918
X-original-commit: f7ca48e9d1ff56ae53ab156114f9dc29534ac3f6
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-10-15 12:02:47 +00:00
Thibault Delavallée f7e7a273cc [IMP] website_sale: make visitor test independent from demo
PURPOSE

Prepare Event Online support by providing fixes and preparatory cleaning
commits.

SPECIFICATIONS

Make visitor tests in website_sale independent from existing visitors and
specially about demo data. Adding demo data makes tests crash which is not
the expected assert of visitor tests.

LINKS

Task ID-2300907 (Event Bugprovements 2)
PR #54621

X-original-commit: 971f26a14d5cbafd65f4370eac14f4cd762b5b44
2020-07-22 11:13:18 +00:00
Jeremy Kersten 79807d6907 [IMP] base, website_sale: handle required zip/state on eCommerce
task-2172788

closes odoo/odoo#54746

Related: odoo/upgrade#1509
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2020-07-22 09:56:03 +00:00
Jorge Pinna Puissant 4b8d716188 [FIX] website_sale: avoid archiving loyalty program products
A product can't be archived if it's used in a pos loyalty program.

opw-2276745

closes odoo/odoo#53948

X-original-commit: 3af9b65638a9725fbeb6597b77328d8f6be5b2ec
Related: odoo/enterprise#11590
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-07-02 07:52:21 +00:00
Martin Trigaux 6db2a81ea2 [IMP] *: use specific ir.property methods
Do not make direct CRUD to ir.property records, use appropriate
methods for that
2020-05-26 15:50:11 +02:00
Adrian Torres 5952928b42 [REM] *: remove various unused import shims
Before this commit, a lot of leftover import shims existed in the
codebase for py2-py3 compatibility, these are no longer needed since
Odoo 13.0+ doesn't support Python 2 anymore and is (finally) in EOL.

With this commit, these shims are dropped, making the code cleaner,
easier to read and with one less dependency.

Queue -> queue -> py2-py3 compatibility
xmlrpclib -> xmlrpc.client -> py2-py3 compatibility
ConfigParser -> configparser -> py2-py3 compatibility
itertools.izip_longest -> itertools.zip_longest -> py2-py3 compatibility
urllib -> urllib.request -> py2-py3 compatibility
__builtins__ -> builtins -> py2-py3 compatibility
_winreg -> winreg -> py2-py3 compatibility

mock -> unittest.mock -> merged into CPython

The debian/fedora packages and requirements.txt have been updated accordingly

closes odoo/odoo#44601

Related: odoo/enterprise#8141
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-04-01 12:45:40 +00:00
Sébastien Theys ce7cc63b58 [FIX] website_sale: prevent issue with test shop_list_view_b2c
It very rarely happens that the test is failing due to the following error:

`Tour shop_list_view_b2c failed at step
.oe_product_cart .oe_currency_value:contains("825.00")`

The value found in that case is 750 instead of 825, which indicates that the b2c
setting was not correctly activated.

To exclude the RPC themselves from the equation, it is decided here to move the
setting change directly in the Python.

closes odoo/odoo#44599

X-original-commit: 735807cefb7ccf3232f7492b825ce8c42bacbed4
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2020-02-04 14:04:45 +00:00
Kevin BaptisteandYannick Tivisse 2ac06038dd [IMP] project, industry_fsm: Improve subtasks and configuration UX
Purpose
=======

In Project, the configuration has to be done twice: in the settings of the
app and on each project.

During the onboarding, the user won't understand that a feature has to be
enabled at both places and will think that the system just doesn't work.

If the user enabled a feature, he most likely intends on using it for most
of his projects. Therefore, having to do a double configuration for each
new project is annoying.

By the way, sub-tasks is the only global feature (it can't be enabled or
disabled by project), so we are breaking it down by project to remain
consistent with the rest.

Specification
=============

1/ Enable subtasks per project
Before this commit, sub-tasks were a global feature (i.e. once enabled
they were enabled for all projects). This commit gives the ability to
enable/disable sub-tasks per project.

2/ Make project_id on planning required

3/ Change default rating status on new projects

4/ Default value for allow_subtasks

5/ Enable timesheets on existing projects

6/ Hide Total Hours if subtasks are disabled

7/ Create project in the company context.
Otherwise some records generation could use a default company which is not
the company for which we want to create a project.

8/ Default value for allow_forecast, is_fsm

9/ Change reference to timesheet product

10/ Fix tracback on industry_fsm_report.
Before this commit, there was a traceback when enabling "Worksheets"
(industry_fsm_report) after "Time and Material" (industry_fsm_sale).

11/ Convert some onchange method into computed editable stored fields

closes odoo/odoo#41218

Taskid: 2146474
Related: odoo/enterprise#6998
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2020-01-31 15:35:54 +00:00
Adrian Torres 8645e31863 [FIX] website_sale: do not pollute the environment
Instead of polluting an existing environment, use the method that was
intended for changing the company `with_company` which returns a brand
new environment and leaves the existing one unchanged.
2020-01-21 08:28:36 +00:00
Victor Feyens 9215e73fa2 [IMP] * : replace with_context(force_company=c) by with_company(c) 2019-11-18 12:25:05 +00:00
Yannick Tivisse bae2d9f717 [IMP] crm, product, ...: Clean some common test classes 2019-11-12 11:34:36 +00:00
Yannick Tivisse c59feb383d [IMP] website_sale: Adapt tests to work with/without demo data 2019-11-05 16:18:10 +01:00
jvm-odoo c22b5a7f4d [FIX] website_sale: fix ecommerce product variant image
On the e-commerce app, you can add product variants.
Those variants can have extra-image.

Before this commit:

    - The variants extra image are displayed on every product of the
      same type and they are duplicated on the product variant.

After this commit:

    - They are displayed only on the concerned product variant,
      without duplication.

OPW-2088261

closes odoo/odoo#39502

X-original-commit: 8efaa086db271cde792da77bca7a95a0d593df4d
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-10-29 10:55:17 +00:00
Christophe Simonis d74b451805 [MERGE] forward port branch 13.0 up to f4105eb9c7 2019-10-09 02:08:17 +02:00
Arnaud Joset 60f03666ab [IMP] product, sale, *: clean the views of attributes and values
* = point_of_sale, sale_management, sale_product_configurator, stock,
    website_sale, website_sale_comparison, website_sale_wishlist

- Remove Attribute Values menu to ease onboarding because everything can be done
  more cleanly through Attributes menu.
- Remove unwanted new lines from help texts.
- Hide color fields when attribute type is not color.
- Move Attribute "Related Products" into a tab because it is less important than
  the rest of fields.

The opportunity is also taken to rename the `type` field of `product.attribute`
to `display_type` to better convey its meaning.

task-2058142

closes odoo/odoo#36313

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-09-20 14:59:05 +00:00
Sébastien Theys b6288e5446 [IMP] *: remove image_64 and clean views
There are too many image sizes. Since they are stored resized this takes time to
generate when saving a new image, it's more rows on the attachment table, more
files on the disk, ...

64px is close enough to 128px that it can be removed without a big impact on
download size.

It will even reduce download and number of requests when both images are
displayed because now only one has to be downloaded and then benefit from cache.

The difference between the two is typically around 1.5kB which is negligible
these days, especially when the request overhead is around 0.5kB already, not
even taking into account other factors such as latency.

If a 64px image must absolutely be returned, it is still possible to pass the
size parameters to the image route. But the current guideline is to handle
resizing in the views when necessary.

Views
=====

- remove width and height attributes when existing CSS rules are overriding them
  (eg. `.oe_kanban_avatar` in the right context)
- add CSS rules instead of width and height attributes when possible
- use `object-fit: cover;` where width and height are forced to avoid distortion
  of non-square images
- for products, use `object-fit: contain;` instead, keep ratio but without crop
- add new CSS rules where the expected size was max 64px*64px before due to the
  image size itself
- remove `img-fluid` where using size classes to avoid conflicting rules

task-2060865

closes odoo/odoo#36147

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-09-19 10:23:39 +00:00
fja-odoo e33172e832 [IMP] website_sale, *: keep track of products viewed
*= website, website_livechat, website_rating

///// Tracking Product /////

Now when a user browse products in eCommerce, we keep track of the
products he looked at. We use the website_visitor
to store the products viewed. A cookie is added with a TTl of 30 min it
will prevent the RPC for that time. We track the page only if the
product view is tracked.

The recently viewed products are displayed as a snippet but also
with the customize option in product pages of website_sale.

Products that are in cart will not be returned as recently viewed.

It is possible to add a recently viewed product to the cart directly
from the carousel, it will not redirect to the cart. If we are on the
cart page, the product is displayed in the cart.

The Visitor page in website now references products viewed

///// Tracking Page /////

Feature to track a view was remove in: https://github.com/odoo/enterprise/pull/4834

That feature is now reintroduced and will use website_track instead of
leads to be stored.

The track field is now on the view instead of the page.

url field is added to website.track, it will store the url for pages and
views

The Visitor page in website now references urls viewed

Add some tests

task-1984575

closes odoo/odoo#35810

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-09-16 09:38:53 +00:00
Christophe Simonis 64e43808b7 [MERGE] forward port branch saas-12.5 up to 58a83d1222 2019-09-20 17:34:45 +02:00
Julien Castiaux 4f03a5f136 [FIX] *: remove old deprecated modules/functions
PEP-594 is deprecating a bunch of modules. As part of the cleanup, we
are also dealing with long deprecated modules, functions and aliases.

* `assert_` -> `assertTrue`
* `assertEquals` -> `assertEqual`
* `assertNotEquals` -> `assertNotEqual`
* `assertAlmostEquals` -> `assertAlmostEqual`
* `assertRaisesRegexp` -> `assertRaisesRegex`
* `assertRegexpMatches` -> `assertRegex`
* `base64.encodestring` -> `base64.encodebytes`
* `base64.decodestring` -> `base64.decodebytes`
* `inspect.getargspec` -> `inspect.signature`
* `inspect.formatargspec` -> `inspect.signature`
* `logging.warn` -> `logging.warning`

closes odoo/odoo#36863

Task: 2003936
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-09-17 11:36:42 +00:00
Sébastien Theys 22a11a6f4d [REF] product, *: save product.template.attribute.value on variants
* account, hr_expense, mrp, sale, sale_product_configurator, stock_account,
  website_sale, website_sale_comparison

Before this commit, the `product.attribute.value` were stored on the variants.
This required filtering of attribute lines to find the appropriate matching
`product.template.attribute.value` that were used in most of the business code,
such as when computing the `price_extra`.

This also prevented to have multiple attribute lines for the same attribute,
which is needed to handle use cases such as grape varieties for wine products.
This will be done in the following commit.

After this commit, the combination of `product.template.attribute.value` will be
directly stored on the product variant.

Other changes
=============

Add `combination_indices` on product, which allows to quickly find a variant
matching a combination (1 simple indexed equality query as opposed to 1 query
with as many joins as there are attribute lines), and to add an easy
SQL constraint to ensure active combination uniqueness.

Add active field on `product.template.attribute.line` and
`product.template.attribute.value`, with the same behavior as variants:

They become archived if they can't be unlinked. This allows to keep the database
consistent, such as archived variants correctly keeping all their values, sales
order lines keeping their custom and no_variant. This is done with the help of
`ondelete=restrict` on the corresponding m2m fields, and the `unlink` methods
falling back to archiving when `unlink` is restricted.

Part of task-1912579

PR: #32946
2019-08-26 13:01:13 +00:00
Raphael Collet 9920f20e4c [IMP] models: ORM speedup
This branch is the combination of several optimizations in the ORM:

* store field values once in the cache: the cache reflects more
faithfully the database, only fields that explicitly depend on the
context have an extra indirection in the cache;

* delay recomputations by default: use method `recompute` to explicitly
flush out pending recomputations;

* delay updates in method `write`: updates are stored in a data
structure that can be flushed efficiently to the database with method
`flush` (which also flush out recomputations);

* make method `modified` take advantage of inverse fields to inverse
dependencies;

* filter records by evaluating a domain on records in Python;

* a computed field with `readonly=False` behaves like a normal field
with an onchange method;

* computed fields are computed in superuser mode by default.

Work done by Toufik Ben Jaa, Raphael Collet, Denis Ledoux and Fabien
Pinckaers.

closes odoo/odoo#35659

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-08-20 12:43:59 +00:00
Victor Feyens 4e5b950741 [FIX] product: pricelist item cannot be without a pricelist ref 2019-08-14 13:39:11 +00:00
Christophe Simonis 140ee6b8f0 [MERGE] forward port branch saas-12.4 up to 98a55917a6 2019-08-14 16:48:10 +02:00
Christophe Simonis b792ba7d9a [MERGE] forward port branch saas-12.3 up to 752b2553c6 2019-08-08 11:52:13 +02:00
Christophe Simonis 0fadd586fa [MERGE] forward port branch 12.0 up to ff9ddfdacc 2019-08-06 15:57:57 +02:00
Sébastien Theys 67e3924bfe [IMP] tools, product, website_sale: rename image_variant_max
Follow up of 58a2ffa26f

Variant specific field `image_raw_original` was meant to be renamed to
`image_variant_1920` instead of `image_variant_max` to follow the same naming
convention as the other fields (having the pixel number in the name).

closes odoo/odoo#35493

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-08-06 12:29:13 +00:00
Romain Derie cc1d78a80b [IMP] *: correctly read/write website_published
The `website_published` field from the website's mixins is basically a readonly
from `is_published` field.
On read, this field will simply read `is_published` and check if the record's
website_id is accessible (only for the multi mixin).
On write, it will always write on `is_published`.

This commit improves a few things:
- A lot of code was writting on website_published which was just then writting
  on is_published. Writting directly on is_published makes more sense.
- Some backend fields would still reference `website_published` instead of
  `is_published` which would just go through the related for no reason.
  Plus, using `is_published` will make the field tooltip more accurate as we
  are not in a website context ('Visible on current website' to 'Is Published')
- Filter and search on tree view were still using the `website_published`
  related field, which is just a readonly when we are not in a frontend
  context.
- Some create and write function would have security check on
  `website_published` value but that was wrong as the user could bypass that by
  simply writting on `is_published`. For the write method, check `is_published`
  is more accurate as it will cover both case since `website_published` will
  then call the write method on `is_published`
2019-08-03 09:51:22 +00:00
Sébastien Theys 1b85ab93ec [IMP] base, product, website_sale: move image zoom out of mixin
This field is not necessary on most models so move it to the few places where it
is needed to avoid computing it and storing it everywhere.

PR: #34925
2019-08-02 16:47:58 +00:00
Sébastien Theys 58a2ffa26f [IMP] *: rename image fields
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small  => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
	what was previously the big size)

+ add new intermediate format:
image_512

PR: #34925
2019-08-02 16:47:58 +00:00
Romain Derie a93e64e4a3 [FIX] website_sale: add tests for previous fix in lower version
In saas-14, 36fdb2ff49 was recently added to fix the flow where an empty
pricelist code being submitted in the cart input should reset the pricelist.

But we waited 12.0 to add an easy test, as we have `MockRequest` to easily
mock and simulate frontend context to test controller in python tests, see
6ebcb1db80.

Following #34711

closes odoo/odoo#35253

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-07-29 10:04:18 +00:00
Martin Trigaux 1f5a4649a6 [MERGE] Forward port of saas-12.3 to saas-12.4 up to 87fc1554d6
closes odoo/odoo#34820

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-12 13:59:35 +00:00