Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.0][NEW] website_sale_product_minimal_price: New module #283

Merged

Conversation

sergio-teruel
Copy link
Contributor

@pedrobaeza pedrobaeza added this to the 11.0 milestone May 7, 2019
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And please rebase for solving Travis

website_sale_product_minimal_price/README.rst Show resolved Hide resolved
website_sale_product_minimal_price/README.rst Outdated Show resolved Hide resolved
#. Go to backend and set a product with variants and extra price by attribute
value.
#. Go to Website Shop.
#. You will see that in main products view appears the text "From " with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From text appears always or only when there are multiple prices? It should be the second IMO. Please specify this in the README when done.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

website_sale_product_minimal_price/i18n/es.po Outdated Show resolved Hide resolved
_inherit = 'product.template'

def _website_price(self):
templates = self.filtered(lambda x: x.product_variant_count > 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be for variants with different prices, not with variants only.

<template id="products_item" inherit_id="website_sale.products_item">
<!-- Display "From" if variants have distinct extra prices -->
<xpath expr="//span[@t-esc='product.website_price']" position="before">
<t t-if="product.product_variant_count &gt; 1 and len(set(product.product_variant_ids.mapped('price_extra'))) != 1">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For achieving this, maybe you need an extra computed stored field at template level for indicating if there are different prices.

@sergio-teruel sergio-teruel force-pushed the 11.0-PR-website_sale_product_minimal_price branch from 6717710 to ddf7200 Compare May 7, 2019 14:15
@sergio-teruel
Copy link
Contributor Author

@pedrobaeza chages done

for template in self:
if (template.product_variant_count and len(set(
template.product_variant_ids.mapped('price_extra'))) != 1):
template.has_variant_price_extra = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This never can't be False if sometime is True?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The field is computed, so by default is False

@sergio-teruel sergio-teruel force-pushed the 11.0-PR-website_sale_product_minimal_price branch from ddf7200 to 4bf95a5 Compare May 8, 2019 09:21
@sergio-teruel
Copy link
Contributor Author

Changes done!!

@sergio-teruel sergio-teruel force-pushed the 11.0-PR-website_sale_product_minimal_price branch from 4bf95a5 to ec6b072 Compare May 8, 2019 09:22
@sergio-teruel
Copy link
Contributor Author

@pedrobaeza please do not merge!!

@pedrobaeza
Copy link
Member

Ok

@sergio-teruel sergio-teruel force-pushed the 11.0-PR-website_sale_product_minimal_price branch from 38b97a4 to 4735d41 Compare May 17, 2019 21:41
…ant price (from pricelists or extra variant price)
@sergio-teruel sergio-teruel force-pushed the 11.0-PR-website_sale_product_minimal_price branch from 4735d41 to 2f1d1ba Compare May 17, 2019 23:59
for product in templates:
variant = product.product_variant_ids.sorted(
key=lambda p: p.website_price)[:1]
product.website_price = variant.website_price
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here can use .write

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rafaelbn rafaelbn merged commit 9e16ff3 into OCA:11.0 May 28, 2019
@rafaelbn rafaelbn deleted the 11.0-PR-website_sale_product_minimal_price branch May 28, 2019 16:39
sergio-teruel added a commit to Tecnativa/e-commerce that referenced this pull request Dec 11, 2019
* [11.0][NEW] website_sale_product_minimal_price: New module

* [11.0][IMP] website_sale_product_minimal_price: Order by minimal variant price (from pricelists or extra variant price)
sergio-teruel added a commit to Tecnativa/e-commerce that referenced this pull request Dec 11, 2019
* [11.0][NEW] website_sale_product_minimal_price: New module

* [11.0][IMP] website_sale_product_minimal_price: Order by minimal variant price (from pricelists or extra variant price)

[UPD] Update website_sale_product_minimal_price.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: e-commerce-11.0/e-commerce-11.0-website_sale_product_minimal_price
Translate-URL: https://translation.odoo-community.org/projects/e-commerce-11-0/e-commerce-11-0-website_sale_product_minimal_price/

[UPD] README.rst
CarlosRoca13 pushed a commit to Tecnativa/e-commerce that referenced this pull request Jun 5, 2020
* [11.0][NEW] website_sale_product_minimal_price: New module

* [11.0][IMP] website_sale_product_minimal_price: Order by minimal variant price (from pricelists or extra variant price)

[UPD] Update website_sale_product_minimal_price.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: e-commerce-11.0/e-commerce-11.0-website_sale_product_minimal_price
Translate-URL: https://translation.odoo-community.org/projects/e-commerce-11-0/e-commerce-11-0-website_sale_product_minimal_price/

[UPD] README.rst
miguel-S73 pushed a commit to Studio73/e-commerce that referenced this pull request Jun 2, 2021
* [11.0][NEW] website_sale_product_minimal_price: New module

* [11.0][IMP] website_sale_product_minimal_price: Order by minimal variant price (from pricelists or extra variant price)

[UPD] Update website_sale_product_minimal_price.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: e-commerce-11.0/e-commerce-11.0-website_sale_product_minimal_price
Translate-URL: https://translation.odoo-community.org/projects/e-commerce-11-0/e-commerce-11-0-website_sale_product_minimal_price/

[UPD] README.rst
miguel-S73 pushed a commit to Studio73/e-commerce that referenced this pull request Jul 15, 2021
* [11.0][NEW] website_sale_product_minimal_price: New module

* [11.0][IMP] website_sale_product_minimal_price: Order by minimal variant price (from pricelists or extra variant price)

[UPD] Update website_sale_product_minimal_price.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: e-commerce-11.0/e-commerce-11.0-website_sale_product_minimal_price
Translate-URL: https://translation.odoo-community.org/projects/e-commerce-11-0/e-commerce-11-0-website_sale_product_minimal_price/

[UPD] README.rst
pilarvargas-tecnativa pushed a commit to Tecnativa/e-commerce that referenced this pull request Feb 24, 2023
* [11.0][NEW] website_sale_product_minimal_price: New module

* [11.0][IMP] website_sale_product_minimal_price: Order by minimal variant price (from pricelists or extra variant price)

[UPD] Update website_sale_product_minimal_price.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: e-commerce-11.0/e-commerce-11.0-website_sale_product_minimal_price
Translate-URL: https://translation.odoo-community.org/projects/e-commerce-11-0/e-commerce-11-0-website_sale_product_minimal_price/

[UPD] README.rst
pilarvargas-tecnativa pushed a commit to Tecnativa/e-commerce that referenced this pull request Mar 22, 2023
* [11.0][NEW] website_sale_product_minimal_price: New module

* [11.0][IMP] website_sale_product_minimal_price: Order by minimal variant price (from pricelists or extra variant price)

[UPD] Update website_sale_product_minimal_price.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: e-commerce-11.0/e-commerce-11.0-website_sale_product_minimal_price
Translate-URL: https://translation.odoo-community.org/projects/e-commerce-11-0/e-commerce-11-0-website_sale_product_minimal_price/

[UPD] README.rst
sbiosca-s73 pushed a commit to Studio73/e-commerce that referenced this pull request Oct 16, 2023
* [11.0][NEW] website_sale_product_minimal_price: New module

* [11.0][IMP] website_sale_product_minimal_price: Order by minimal variant price (from pricelists or extra variant price)

[UPD] Update website_sale_product_minimal_price.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: e-commerce-11.0/e-commerce-11.0-website_sale_product_minimal_price
Translate-URL: https://translation.odoo-community.org/projects/e-commerce-11-0/e-commerce-11-0-website_sale_product_minimal_price/

[UPD] README.rst
Pablocce pushed a commit to factorlibre/e-commerce that referenced this pull request Feb 20, 2024
* [11.0][NEW] website_sale_product_minimal_price: New module

* [11.0][IMP] website_sale_product_minimal_price: Order by minimal variant price (from pricelists or extra variant price)

[UPD] Update website_sale_product_minimal_price.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: e-commerce-11.0/e-commerce-11.0-website_sale_product_minimal_price
Translate-URL: https://translation.odoo-community.org/projects/e-commerce-11-0/e-commerce-11-0-website_sale_product_minimal_price/

[UPD] README.rst
stevTresCloud pushed a commit to TRESCLOUD/e-commerce that referenced this pull request Apr 18, 2024
* [11.0][NEW] website_sale_product_minimal_price: New module

* [11.0][IMP] website_sale_product_minimal_price: Order by minimal variant price (from pricelists or extra variant price)

[UPD] Update website_sale_product_minimal_price.pot

Update translation files

Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: e-commerce-11.0/e-commerce-11.0-website_sale_product_minimal_price
Translate-URL: https://translation.odoo-community.org/projects/e-commerce-11-0/e-commerce-11-0-website_sale_product_minimal_price/

[UPD] README.rst
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants