-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by lmignon
- Loading branch information
Showing
39 changed files
with
719 additions
and
448 deletions.
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
1 change: 1 addition & 0 deletions
1
setup/shopinvader_product_brand/odoo/addons/shopinvader_product_brand
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 @@ | ||
../../../../shopinvader_product_brand |
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,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
1 change: 1 addition & 0 deletions
1
...opinvader_search_engine_product_brand/odoo/addons/shopinvader_search_engine_product_brand
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 @@ | ||
../../../../shopinvader_search_engine_product_brand |
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,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,4 +1 @@ | ||
from . import shopinvader_brand | ||
from . import product_brand | ||
from . import shopinvader_product | ||
from . import shopinvader_backend |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,2 +1,3 @@ | ||
* Sebastien BEAU <[email protected]> | ||
* Simone Orsi <[email protected]> | ||
* Marie Lejeune <[email protected]> |
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,3 +1,12 @@ | ||
This module allow you to manage brand on your `Shopinvader`_ website | ||
This module focus on the serialization of brand information into JSON objects | ||
in the context of the `Shopinvader`_ project. These information are mainly used | ||
to be made available for a `Shopinvader`_ website through an export to search | ||
engine indexation services like ElasticSearch / OpenSearch. | ||
|
||
* It defines a new specific Pydantic model to be used to serialize a *product.brand* | ||
record into a JSON object. | ||
|
||
* It extends the ProductProduct Pydantic model to add the brand information in the | ||
JSON exported for a product.product record. | ||
|
||
.. _Shopinvader: https://shopinvader.com |
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 .brand import ProductBrand | ||
from .product import ProductTemplate |
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,32 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from extendable_pydantic import StrictExtendableBaseModel | ||
|
||
|
||
class ProductBrand(StrictExtendableBaseModel): | ||
id: int | ||
name: str | ||
sequence: int | None = None | ||
description: str | None = None | ||
short_description: str | None = None | ||
meta_description: str | None = None | ||
meta_keywords: str | None = None | ||
seo_title: str | None = None | ||
url_key: str | None = None | ||
redirect_url_key: str | None = None | ||
|
||
@classmethod | ||
def from_product_brand(cls, odoo_rec): | ||
return cls.model_construct( | ||
id=odoo_rec.id, | ||
name=odoo_rec.name, | ||
sequence=odoo_rec.sequence or None, | ||
description=odoo_rec.description or None, | ||
short_description=odoo_rec.short_description or None, | ||
meta_description=odoo_rec.meta_description or None, | ||
meta_keywords=odoo_rec.meta_keywords or None, | ||
seo_title=odoo_rec.seo_title or None, | ||
url_key=odoo_rec.url_key or None, | ||
redirect_url_key=odoo_rec.redirect_url_key or None, | ||
) |
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,22 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.addons.shopinvader_product.schemas import ( | ||
ProductTemplate as BaseProductTemplate, | ||
) | ||
|
||
from . import ProductBrand | ||
|
||
|
||
class ProductTemplate(BaseProductTemplate, extends=True): | ||
brand: ProductBrand | None = None | ||
|
||
@classmethod | ||
def from_product_template(cls, odoo_rec): | ||
obj = super().from_product_template(odoo_rec) | ||
obj.brand = ( | ||
ProductBrand.from_product_brand(odoo_rec.product_brand_id) | ||
if odoo_rec.product_brand_id | ||
else None | ||
) | ||
return obj |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.