-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
shopinvader_base_url: add fields url_key and redirect_url_key, shopin…
…vader_product_url add fields to schemas
- Loading branch information
Showing
6 changed files
with
64 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import models | ||
from . import schemas |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from . import category | ||
from . import product |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.addons.shopinvader_product.schemas.category import ( | ||
ShortShopinvaderCategory as BaseShortShopinvaderCategory, | ||
ShopinvaderCategory as BaseShopinvaderCategory, | ||
) | ||
|
||
|
||
class ShortShopinvaderCategory(BaseShortShopinvaderCategory, extends=True): | ||
url_key: str | None = None | ||
|
||
@classmethod | ||
def from_shopinvader_category(cls, odoo_rec): | ||
obj = super().from_shopinvader_category(odoo_rec) | ||
obj.url_key = odoo_rec.url_key or None | ||
return obj | ||
|
||
|
||
class ShopinvaderCategory(BaseShopinvaderCategory, extends=True): | ||
redirect_url_key: list[str] = [] | ||
|
||
@classmethod | ||
def from_shopinvader_category(cls, odoo_rec): | ||
obj = super().from_shopinvader_category(odoo_rec) | ||
obj.redirect_url_key = odoo_rec.redirect_url_key | ||
return obj |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.addons.shopinvader_product.schemas.product import ( | ||
ShopinvaderVariant as BaseShopinvaderVariant, | ||
) | ||
|
||
|
||
class ShopinvaderVariant(BaseShopinvaderVariant, extends=True): | ||
url_key: str | None = None | ||
redirect_url_key: list[str] = [] | ||
|
||
@classmethod | ||
def from_shopinvader_variant(cls, odoo_rec): | ||
obj = super().from_shopinvader_variant(odoo_rec) | ||
obj.url_key = odoo_rec.url_key or None | ||
obj.redirect_url_key = odoo_rec.redirect_url_key | ||
return obj |