From a0f87180a7cb9f6ace413ee6b9a632c070a6057b Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (ACSONE)" Date: Wed, 20 Mar 2024 13:58:55 +0100 Subject: [PATCH 1/3] [FIX] base_rest: Fix tests after changes into odoo see https://github.com/odoo/odoo/commit/65a19492a8044be4f05a8200a6956c3e50b69eab The payment must have the the journal as the payment_method --- shopinvader_restapi/tests/test_invoice.py | 1 + shopinvader_restapi/tests/test_sale.py | 1 + 2 files changed, 2 insertions(+) diff --git a/shopinvader_restapi/tests/test_invoice.py b/shopinvader_restapi/tests/test_invoice.py index 7eae930582..a72946db82 100644 --- a/shopinvader_restapi/tests/test_invoice.py +++ b/shopinvader_restapi/tests/test_invoice.py @@ -21,6 +21,7 @@ def setUpClass(cls): cls.bank_journal_euro = cls.journal_obj.create( {"name": "Bank", "type": "bank", "code": "BNK627"} ) + cls.payment_method_line_manual_in.journal_id = cls.bank_journal_euro cls.invoice_obj = cls.env["account.move"] cls.invoice = cls._confirm_and_invoice_sale(cls, cls.sale) cls.non_sale_invoice = cls.invoice.copy() diff --git a/shopinvader_restapi/tests/test_sale.py b/shopinvader_restapi/tests/test_sale.py index 3fc402c13d..6b02134002 100644 --- a/shopinvader_restapi/tests/test_sale.py +++ b/shopinvader_restapi/tests/test_sale.py @@ -26,6 +26,7 @@ def setUpClass(cls): cls.bank_journal_euro = cls.journal_obj.create( {"name": "Bank", "type": "bank", "code": "BNK6278"} ) + cls.payment_method_line_manual_in.journal_id = cls.bank_journal_euro def setUp(self, *args, **kwargs): super().setUp(*args, **kwargs) From 0be17b57b0137266d8de7e584c761f7c915a4762 Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (ACSONE)" Date: Wed, 20 Mar 2024 14:29:43 +0100 Subject: [PATCH 2/3] [FIX] *_wishlist: Fix after refactoring by Tecnativa 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 https://github.com/OCA/sale-workflow/pull/3009 --- shopinvader_api_wishlist/README.rst | 2 +- shopinvader_api_wishlist/__manifest__.py | 2 +- shopinvader_api_wishlist/dependencies.py | 4 ++-- ..._product_set_add.xml => acl_sale_product_set_wizard.xml} | 6 +++--- shopinvader_api_wishlist/static/description/index.html | 2 +- shopinvader_api_wishlist/wizard/__init__.py | 2 +- .../{product_set_add.py => sale_product_set_wizard.py} | 6 +++--- shopinvader_wishlist/services/wishlist.py | 2 +- shopinvader_wishlist/wizard/__init__.py | 2 +- .../{product_set_add.py => sale_product_set_wizard.py} | 2 +- 10 files changed, 15 insertions(+), 15 deletions(-) rename shopinvader_api_wishlist/security/{acl_product_set_add.xml => acl_sale_product_set_wizard.xml} (62%) rename shopinvader_api_wishlist/wizard/{product_set_add.py => sale_product_set_wizard.py} (75%) rename shopinvader_wishlist/wizard/{product_set_add.py => sale_product_set_wizard.py} (95%) diff --git a/shopinvader_api_wishlist/README.rst b/shopinvader_api_wishlist/README.rst index 6391187968..7b7ea7947d 100644 --- a/shopinvader_api_wishlist/README.rst +++ b/shopinvader_api_wishlist/README.rst @@ -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 diff --git a/shopinvader_api_wishlist/__manifest__.py b/shopinvader_api_wishlist/__manifest__.py index 46932250df..ed6185086a 100644 --- a/shopinvader_api_wishlist/__manifest__.py +++ b/shopinvader_api_wishlist/__manifest__.py @@ -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", ], diff --git a/shopinvader_api_wishlist/dependencies.py b/shopinvader_api_wishlist/dependencies.py index 5bdaec86e8..4673df107e 100644 --- a/shopinvader_api_wishlist/dependencies.py +++ b/shopinvader_api_wishlist/dependencies.py @@ -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, @@ -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, diff --git a/shopinvader_api_wishlist/security/acl_product_set_add.xml b/shopinvader_api_wishlist/security/acl_sale_product_set_wizard.xml similarity index 62% rename from shopinvader_api_wishlist/security/acl_product_set_add.xml rename to shopinvader_api_wishlist/security/acl_sale_product_set_wizard.xml index 3bf6f2db11..c1f78d2c0e 100644 --- a/shopinvader_api_wishlist/security/acl_product_set_add.xml +++ b/shopinvader_api_wishlist/security/acl_sale_product_set_wizard.xml @@ -3,9 +3,9 @@ License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). --> - - product.set.add shopinvader user read access - + + sale.product.set.wizard shopinvader user read access + diff --git a/shopinvader_api_wishlist/static/description/index.html b/shopinvader_api_wishlist/static/description/index.html index 5e308d914e..9ee0ca676b 100644 --- a/shopinvader_api_wishlist/static/description/index.html +++ b/shopinvader_api_wishlist/static/description/index.html @@ -367,7 +367,7 @@

Shopinvader Wishlist

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:116b285cc0a03e1c416dfffba3d21a6ed22025dad3d0e7082ec5a39fa6251f2c +!! source digest: sha256:7dc1f734fdf37e07a8fb33f8eb21c83bc0954558788be81ba2e22b56f580f951 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 shopinvader/odoo-shopinvader

Expose wishlist features for Shopinvader websites.

diff --git a/shopinvader_api_wishlist/wizard/__init__.py b/shopinvader_api_wishlist/wizard/__init__.py index 092f8c9874..3e13472fb7 100644 --- a/shopinvader_api_wishlist/wizard/__init__.py +++ b/shopinvader_api_wishlist/wizard/__init__.py @@ -1 +1 @@ -from . import product_set_add +from . import sale_product_set_wizard diff --git a/shopinvader_api_wishlist/wizard/product_set_add.py b/shopinvader_api_wishlist/wizard/sale_product_set_wizard.py similarity index 75% rename from shopinvader_api_wishlist/wizard/product_set_add.py rename to shopinvader_api_wishlist/wizard/sale_product_set_wizard.py index 94b47d0a0c..8df1be27ef 100644 --- a/shopinvader_api_wishlist/wizard/product_set_add.py +++ b/shopinvader_api_wishlist/wizard/sale_product_set_wizard.py @@ -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 @@ -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 ) diff --git a/shopinvader_wishlist/services/wishlist.py b/shopinvader_wishlist/services/wishlist.py index 77e7f75793..a19b3a4cfe 100644 --- a/shopinvader_wishlist/services/wishlist.py +++ b/shopinvader_wishlist/services/wishlist.py @@ -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, diff --git a/shopinvader_wishlist/wizard/__init__.py b/shopinvader_wishlist/wizard/__init__.py index 092f8c9874..3e13472fb7 100644 --- a/shopinvader_wishlist/wizard/__init__.py +++ b/shopinvader_wishlist/wizard/__init__.py @@ -1 +1 @@ -from . import product_set_add +from . import sale_product_set_wizard diff --git a/shopinvader_wishlist/wizard/product_set_add.py b/shopinvader_wishlist/wizard/sale_product_set_wizard.py similarity index 95% rename from shopinvader_wishlist/wizard/product_set_add.py rename to shopinvader_wishlist/wizard/sale_product_set_wizard.py index dfb5e6e3db..7b709694e4 100644 --- a/shopinvader_wishlist/wizard/product_set_add.py +++ b/shopinvader_wishlist/wizard/sale_product_set_wizard.py @@ -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" From 29373c31341b46abca7cffbce74076df96f1e02a Mon Sep 17 00:00:00 2001 From: "Laurent Mignon (ACSONE)" Date: Wed, 20 Mar 2024 14:58:16 +0100 Subject: [PATCH 3/3] [FIX] shopinvader_product_stock_assortment: Avoid error in log This addon is not installable by depends on removed addons. Due to a change into odoo the dependencies are checked despite the addon is declared as not installable. see https://github.com/odoo/odoo/issues/141747 --- shopinvader_product_stock_assortment/__manifest__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shopinvader_product_stock_assortment/__manifest__.py b/shopinvader_product_stock_assortment/__manifest__.py index 1748ce8a7d..0b79642f17 100644 --- a/shopinvader_product_stock_assortment/__manifest__.py +++ b/shopinvader_product_stock_assortment/__manifest__.py @@ -11,6 +11,6 @@ "author": "ACSONE SA/NV", "license": "AGPL-3", "installable": False, - "depends": ["shopinvader_product_stock", "shopinvader_assortment"], - "auto_install": True, + # "depends": ["shopinvader_product_stock", "shopinvader_assortment"], no more exists + # "auto_install": True, }