Skip to content

Commit

Permalink
[FIX] *_wishlist: Fix after refactoring by Tecnativa
Browse files Browse the repository at this point in the history
Due to a refactoring by Tecnativa of the sale_product_set addon on a stable branch, the model 'product.set.add' has been removed and replaced by 'sale.product.set.wizard'

See OCA/sale-workflow#3009
  • Loading branch information
lmignon committed Mar 20, 2024
1 parent a0f8718 commit 0be17b5
Show file tree
Hide file tree
Showing 10 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion shopinvader_api_wishlist/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Shopinvader Wishlist
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:116b285cc0a03e1c416dfffba3d21a6ed22025dad3d0e7082ec5a39fa6251f2c
!! source digest: sha256:7dc1f734fdf37e07a8fb33f8eb21c83bc0954558788be81ba2e22b56f580f951
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion shopinvader_api_wishlist/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"demo": [],
"data": [
"security/groups.xml",
"security/acl_product_set_add.xml",
"security/acl_sale_product_set_wizard.xml",
"security/rule+acl_product_set.xml",
"security/rule+acl_product_set_line.xml",
],
Expand Down
4 changes: 2 additions & 2 deletions shopinvader_api_wishlist/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def _add_to_cart(
uuid = rqst.uuid if rqst else None
cart = self.env["sale.order"]._find_open_cart(self.partner.id, uuid)
product_set = self._get(record_id)
wizard = self.env["product.set.add"].create(
wizard = self.env["sale.product.set.wizard"].create(
{
"order_id": cart.id,
"product_set_id": product_set.id,
Expand All @@ -111,7 +111,7 @@ def _add_items_to_cart(
lines = product_set.set_line_ids.filtered(
lambda l, product_ids=product_ids: l.product_id.id in product_ids
)
wizard = self.env["product.set.add"].create(
wizard = self.env["sale.product.set.wizard"].create(
{
"order_id": cart.id,
"product_set_id": product_set.id,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<odoo>

<record model="ir.model.access" id="shopinvader_product_set_add_access">
<field name="name">product.set.add shopinvader user read access</field>
<field name="model_id" ref="sale_product_set.model_product_set_add" />
<record model="ir.model.access" id="shopinvader_sale_product_set_wizard_access">
<field name="name">sale.product.set.wizard shopinvader user read access</field>
<field name="model_id" ref="sale_product_set.model_sale_product_set_wizard" />
<field name="group_id" ref="shopinvader_wishlist_user_group" />
<field name="perm_read" eval="1" />
<field name="perm_create" eval="1" />
Expand Down
2 changes: 1 addition & 1 deletion shopinvader_api_wishlist/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Shopinvader Wishlist</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:116b285cc0a03e1c416dfffba3d21a6ed22025dad3d0e7082ec5a39fa6251f2c
!! source digest: sha256:7dc1f734fdf37e07a8fb33f8eb21c83bc0954558788be81ba2e22b56f580f951
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<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/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/shopinvader/odoo-shopinvader/tree/16.0/shopinvader_api_wishlist"><img alt="shopinvader/odoo-shopinvader" src="https://img.shields.io/badge/github-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github" /></a></p>
<p>Expose wishlist features for Shopinvader websites.</p>
Expand Down
2 changes: 1 addition & 1 deletion shopinvader_api_wishlist/wizard/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import product_set_add
from . import sale_product_set_wizard
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
from odoo import models


class ProductSetAdd(models.TransientModel):
_inherit = "product.set.add"
class SaleProductSetWizard(models.TransientModel):
_inherit = "sale.product.set.wizard"

def prepare_sale_order_line_data(self, set_line, max_sequence=0):
# check if user is in the group of shopinvader_wishlist_user_group
Expand All @@ -14,6 +14,6 @@ def prepare_sale_order_line_data(self, set_line, max_sequence=0):
"shopinvader_api_wishlist.shopinvader_wishlist_user_group"
):
self_super = self.sudo()
return super(ProductSetAdd, self_super).prepare_sale_order_line_data(
return super(SaleProductSetWizard, self_super).prepare_sale_order_line_data(
set_line, max_sequence
)
2 changes: 1 addition & 1 deletion shopinvader_wishlist/services/wishlist.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def _get_base_search_domain(self):
return self._default_domain_for_partner_records()

def _get_add_to_cart_wizard(self, record, cart):
return self.env["product.set.add"].create(
return self.env["sale.product.set.wizard"].create(
{
"order_id": cart.id,
"product_set_id": record.id,
Expand Down
2 changes: 1 addition & 1 deletion shopinvader_wishlist/wizard/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from . import product_set_add
from . import sale_product_set_wizard
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


class ProductSetAdd(models.TransientModel):
_inherit = "product.set.add"
_inherit = "sale.product.set.wizard"

shopinvader_backend_id = fields.Many2one(
related="product_set_id.shopinvader_backend_id"
Expand Down

0 comments on commit 0be17b5

Please sign in to comment.