-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] shopinvader_product_brand_tag: Migration to 16.0
- Loading branch information
1 parent
dec7f9c
commit c1781b8
Showing
9 changed files
with
36 additions
and
69 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
from . import models | ||
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.
27 changes: 0 additions & 27 deletions
27
shopinvader_product_brand_tag/data/ir_export_product_brand.xml
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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from .brand import ProductBrand | ||
from .brand_tag import ProductBrandTag |
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,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 |
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,13 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). | ||
|
||
from odoo.addons.extendable_fastapi 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) |