Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0] [MIG] shopinvader_product_brand_tag #1409

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
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ exclude: |
^shopinvader_pos/|
^shopinvader_price_per_qty/|
^shopinvader_product_attribute_set/|
^shopinvader_product_brand_tag/|
^shopinvader_product_manufactured_for/|
^shopinvader_product_media/|
^shopinvader_product_new/|
Expand Down
6 changes: 6 additions & 0 deletions setup/shopinvader_product_brand_tag/setup.py
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: 0 additions & 1 deletion shopinvader_product_brand_tag/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
from . import models
12 changes: 5 additions & 7 deletions shopinvader_product_brand_tag/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
{
"name": "Shopvinvader Product Brand Tag",
"summary": "Index Product Brand Tags in Shopinvader",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"category": "e-Commerce",
"website": "https://github.com/shopinvader/odoo-shopinvader",
"author": "Camptocamp",
"author": "Camptocamp,ACSONE SA/NV",
"license": "AGPL-3",
"depends": ["shopinvader_product_brand", "product_brand_tag"],
"data": [
"data/ir_export_product_brand.xml",
"data/ir_export_product.xml",
],
"installable": False,
"installable": True,
"external_dependencies": {"python": ["extendable_pydantic>=1.2.0"]},
"development_status": "Alpha",
}
17 changes: 0 additions & 17 deletions shopinvader_product_brand_tag/data/ir_export_product.xml

This file was deleted.

27 changes: 0 additions & 27 deletions shopinvader_product_brand_tag/data/ir_export_product_brand.xml

This file was deleted.

1 change: 0 additions & 1 deletion shopinvader_product_brand_tag/models/__init__.py

This file was deleted.

18 changes: 0 additions & 18 deletions shopinvader_product_brand_tag/models/shopinvader_brand.py

This file was deleted.

1 change: 1 addition & 0 deletions shopinvader_product_brand_tag/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
* `Camptocamp <https://www.camptocamp.com>`_

* Iván Todorovich <[email protected]>
* Marie Lejeune <[email protected]>
2 changes: 2 additions & 0 deletions shopinvader_product_brand_tag/schemas/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from .brand import ProductBrand
from .brand_tag import ProductBrandTag
20 changes: 20 additions & 0 deletions shopinvader_product_brand_tag/schemas/brand.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo.addons.shopinvader_product_brand.schemas import (
ProductBrand as BaseProductBrand,
)

from . import ProductBrandTag


class ProductBrand(BaseProductBrand):
tags: list[ProductBrandTag] = []

@classmethod
def from_product_brand(cls, odoo_rec):
obj = super().from_product_brand(odoo_rec)
obj.tags = [
ProductBrandTag.from_product_brand_tag(tag) for tag in odoo_rec.tag_ids
]
return obj
13 changes: 13 additions & 0 deletions shopinvader_product_brand_tag/schemas/brand_tag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from extendable_pydantic import StrictExtendableBaseModel


class ProductBrandTag(StrictExtendableBaseModel):
id: int
name: str

@classmethod
def from_product_brand_tag(cls, odoo_rec):
return cls.model_construct(id=odoo_rec.id, name=odoo_rec.name)
Loading