Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ addon | version | maintainers | summary
[website_sale_checkout_skip_payment](website_sale_checkout_skip_payment/) | 17.0.1.0.1 | | Skip payment for logged users in checkout process
[website_sale_comparison_hide_price](website_sale_comparison_hide_price/) | 17.0.1.0.0 | | Hide product prices on the shop
[website_sale_empty_cart](website_sale_empty_cart/) | 17.0.1.0.0 | | Adds a button in the website cart to empty all
[website_sale_hide_empty_category](website_sale_hide_empty_category/) | 17.0.1.0.1 | | Hide any Product Categories that are empty
[website_sale_hide_empty_category](website_sale_hide_empty_category/) | 17.0.1.0.2 | | Hide any Product Categories that are empty
[website_sale_hide_price](website_sale_hide_price/) | 17.0.1.2.1 | | Hide product prices on the shop
[website_sale_menu_partner_top_selling](website_sale_menu_partner_top_selling/) | 17.0.1.0.0 | <a href='https://github.com/pilarvargas-tecnativa'><img src='https://github.com/pilarvargas-tecnativa.png' width='32' height='32' style='border-radius:50%;' alt='pilarvargas-tecnativa'/></a> | Displays the user's regular products in the e-commerce.
[website_sale_order_type](website_sale_order_type/) | 17.0.1.0.0 | <a href='https://github.com/pilarvargas-tecnativa'><img src='https://github.com/pilarvargas-tecnativa.png' width='32' height='32' style='border-radius:50%;' alt='pilarvargas-tecnativa'/></a> | This module allows sale_order_type to work with website_sale.
Expand All @@ -40,7 +40,7 @@ addon | version | maintainers | summary
[website_sale_product_detail_attribute_image](website_sale_product_detail_attribute_image/) | 17.0.1.0.0 | | Display attributes images in shop product detail
[website_sale_product_matrix](website_sale_product_matrix/) | 17.0.1.0.1 | <a href='https://github.com/pilarvargas-tecnativa'><img src='https://github.com/pilarvargas-tecnativa.png' width='32' height='32' style='border-radius:50%;' alt='pilarvargas-tecnativa'/></a> | Product matrix in eCommerce
[website_sale_product_minimal_price](website_sale_product_minimal_price/) | 17.0.1.0.0 | <a href='https://github.com/sergio-teruel'><img src='https://github.com/sergio-teruel.png' width='32' height='32' style='border-radius:50%;' alt='sergio-teruel'/></a> | Display minimal price for products that has variants
[website_sale_product_multi_website](website_sale_product_multi_website/) | 17.0.1.0.0 | | Show products in many websites
[website_sale_product_multi_website](website_sale_product_multi_website/) | 17.0.1.0.1 | | Show products in many websites
[website_sale_product_reference_displayed](website_sale_product_reference_displayed/) | 17.0.1.0.0 | | Display product reference in e-commerce
[website_sale_require_legal](website_sale_require_legal/) | 17.0.1.0.0 | | Force the user to accept legal tems to buy in the web shop
[website_sale_resource_booking](website_sale_resource_booking/) | 17.0.1.0.0 | <a href='https://github.com/Yajo'><img src='https://github.com/Yajo.png' width='32' height='32' style='border-radius:50%;' alt='Yajo'/></a> | Let customers book resources temporarily before buying
Expand Down
2 changes: 1 addition & 1 deletion website_sale_hide_empty_category/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Website Sale - Hide Empty Categories
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c74afdee8feb094a415bb0ca0a6f09be384a397c16be4651b656dbe03289a748
!! source digest: sha256:ad0bd9067e6213fa5f65c67af6b295f29a64b66b14f4feda341f42dfdc5c3887
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion website_sale_hide_empty_category/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"name": "Website Sale - Hide Empty Categories",
"summary": "Hide any Product Categories that are empty",
"version": "17.0.1.0.1",
"version": "17.0.1.0.2",
"category": "Website",
"website": "https://github.com/OCA/e-commerce",
"author": "LasLabs, Odoo Community Association (OCA)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ProductPublicCategory(models.Model):
def _compute_has_product_recursive(self):
for category in self:
website = self.env["website"].get_current_website()
website_domain = website.website_domain()
website_domain = website.sale_product_domain()
has_products = bool(
category.product_tmpl_ids.filtered_domain(website_domain)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h1>Website Sale - Hide Empty Categories</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:c74afdee8feb094a415bb0ca0a6f09be384a397c16be4651b656dbe03289a748
!! source digest: sha256:ad0bd9067e6213fa5f65c67af6b295f29a64b66b14f4feda341f42dfdc5c3887
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/e-commerce/tree/17.0/website_sale_hide_empty_category"><img alt="OCA/e-commerce" src="https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/e-commerce-17-0/e-commerce-17-0-website_sale_hide_empty_category"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/e-commerce&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Removes any category links from the Shop which have no products
Expand Down
2 changes: 1 addition & 1 deletion website_sale_product_multi_website/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Website Sale Product Multi Website
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5c7f9e4c26b67d7776a145b462d49b9e6dd1d527ff4dad8367c951aa2e35138b
!! source digest: sha256:e7d42e1d75e88d24770bee26291bd6d25c236823b6a50fce99569110e9327689
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion website_sale_product_multi_website/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Website Sale Product Multi Website",
"summary": "Show products in many websites",
"version": "17.0.1.0.0",
"version": "17.0.1.0.1",
"category": "Website",
"author": "Odoo Community Association (OCA), Adhoc S.A.",
"license": "AGPL-3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ def _compute_website_id(self):

def _inverse_website_id(self):
for record in self:
record.website_ids = record.website_id
if record.website_id and record.website_id not in record.website_ids:
record.website_ids = [(4, record.website_id.id)]

def can_access_from_current_website(self, website_id=False):
# We overwrite this method completely in order to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ <h1>Website Sale Product Multi Website</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5c7f9e4c26b67d7776a145b462d49b9e6dd1d527ff4dad8367c951aa2e35138b
!! source digest: sha256:e7d42e1d75e88d24770bee26291bd6d25c236823b6a50fce99569110e9327689
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/e-commerce/tree/17.0/website_sale_product_multi_website"><img alt="OCA/e-commerce" src="https://img.shields.io/badge/github-OCA%2Fe--commerce-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/e-commerce-17-0/e-commerce-17-0-website_sale_product_multi_website"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/e-commerce&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module extends that behavior by allowing products to be linked to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,26 @@ def test_03_product_is_visible_only_on_assigned_website_shop(self):
)
self.assertEqual(response.status_code, 200)
self.assertNotIn(product_url, response.text)

def test_04_website_ids_are_preserved_when_multiple_websites_are_assigned(self):
self.product_template.website_ids = self.website1 + self.website2
self.assertEqual(self.product_template.website_id, self.website1)
self.assertEqual(
self.product_template.website_ids, self.website1 + self.website2
)

def test_05_inverse_adds_website_without_replacing_existing_websites(self):
self.product_template.website_ids = self.website1 + self.website2
self.product_template.website_id = self.website0
self.assertEqual(
set(self.product_template.website_ids.ids),
set((self.website0 + self.website1 + self.website2).ids),
)

def test_06_inverse_does_not_duplicate_existing_website(self):
self.product_template.website_ids = self.website1 + self.website2
self.product_template.website_id = self.website1
self.assertEqual(
set(self.product_template.website_ids.ids),
set((self.website1 + self.website2).ids),
)
Loading