-
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.
- Loading branch information
Showing
24 changed files
with
231 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
...r_search_engine_product_brand_tag/odoo/addons/shopinvader_search_engine_product_brand_tag
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_tag |
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
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
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
36 changes: 36 additions & 0 deletions
36
shopinvader_search_engine/models/se_product_update_mixin.py
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,36 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
|
||
from odoo import api, models | ||
|
||
|
||
class SEProductUpdateMixin(models.AbstractModel): | ||
_name = "se.product.update.mixin" | ||
|
||
@api.model | ||
def create(self, values): | ||
res = super(SEProductUpdateMixin, self).create(values) | ||
res.get_products().shopinvader_mark_to_update() | ||
return res | ||
|
||
def write(self, vals): | ||
needs_update = self.needs_product_update(vals) | ||
if needs_update: | ||
products = self.get_products() | ||
res = super(SEProductUpdateMixin, self).write(vals) | ||
if needs_update: | ||
(products | self.get_products()).shopinvader_mark_to_update() | ||
return res | ||
|
||
def unlink(self): | ||
products = self.get_products() | ||
res = super(SEProductUpdateMixin, self).unlink() | ||
products.shopinvader_mark_to_update() | ||
return res | ||
|
||
def get_products(self): | ||
raise NotImplementedError | ||
|
||
def needs_product_update(self, vals): | ||
return 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 fs_product_image | ||
from . import se_backend |
26 changes: 26 additions & 0 deletions
26
shopinvader_search_engine_image/models/fs_product_image.py
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,26 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class FsProductImage(models.Model): | ||
_name = "fs.product.image" | ||
_inherit = ["fs.product.image", "se.product.update.mixin"] | ||
|
||
@api.model_create_multi | ||
def create(self, vals_list): | ||
res = super(FsProductImage, self).create(vals_list) | ||
res.product_tmpl_id.shopinvader_mark_to_update() | ||
return res | ||
|
||
def write(self, vals): | ||
res = super(FsProductImage, self).write(vals) | ||
self.mapped("product_tmpl_id").shopinvader_mark_to_update() | ||
return res | ||
|
||
def unlink(self): | ||
products = self.mapped("product_tmpl_id") | ||
res = super(FsProductImage, self).unlink() | ||
products.shopinvader_mark_to_update() | ||
return res |
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 |
1 change: 1 addition & 0 deletions
1
shopinvader_search_engine_product_brand_image/models/__init__.py
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 @@ | ||
from . import fs_product_brand_image |
26 changes: 26 additions & 0 deletions
26
shopinvader_search_engine_product_brand_image/models/fs_product_brand_image.py
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,26 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class FsProductImage(models.Model): | ||
_name = "fs.product.brand.image" | ||
_inherit = ["fs.product.brand.image", "se.product.update.mixin"] | ||
|
||
@api.model_create_multi | ||
def create(self, vals_list): | ||
res = super(FsProductImage, self).create(vals_list) | ||
res.product_tmpl_id.shopinvader_mark_to_update() | ||
return res | ||
|
||
def write(self, vals): | ||
res = super(FsProductImage, self).write(vals) | ||
self.mapped("product_tmpl_id").shopinvader_mark_to_update() | ||
return res | ||
|
||
def unlink(self): | ||
products = self.mapped("product_tmpl_id") | ||
res = super(FsProductImage, self).unlink() | ||
products.shopinvader_mark_to_update() | ||
return res |
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,35 @@ | ||
**This file is going to be generated by oca-gen-addon-readme.** | ||
|
||
*Manual changes will be overwritten.* | ||
|
||
Please provide content in the ``readme`` directory: | ||
|
||
* **DESCRIPTION.rst** (required) | ||
* INSTALL.rst (optional) | ||
* CONFIGURE.rst (optional) | ||
* **USAGE.rst** (optional, highly recommended) | ||
* DEVELOP.rst (optional) | ||
* ROADMAP.rst (optional) | ||
* HISTORY.rst (optional, recommended) | ||
* **CONTRIBUTORS.rst** (optional, highly recommended) | ||
* CREDITS.rst (optional) | ||
|
||
Content of this README will also be drawn from the addon manifest, | ||
from keys such as name, authors, maintainers, development_status, | ||
and license. | ||
|
||
A good, one sentence summary in the manifest is also highly recommended. | ||
|
||
|
||
Automatic changelog generation | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
`HISTORY.rst` can be auto generated using `towncrier <https://pypi.org/project/towncrier>`_. | ||
|
||
Just put towncrier compatible changelog fragments into `readme/newsfragments` | ||
and the changelog file will be automatically generated and updated when a new fragment is added. | ||
|
||
Please refer to `towncrier` documentation to know more. | ||
|
||
NOTE: the changelog will be automatically generated when using `/ocabot merge $option`. | ||
If you need to run it manually, refer to `OCA/maintainer-tools README <https://github.com/OCA/maintainer-tools>`_. |
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 @@ | ||
from . import models |
18 changes: 18 additions & 0 deletions
18
shopinvader_search_engine_product_brand_tag/__manifest__.py
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). | ||
|
||
{ | ||
"name": "Shopinvader Seach Engine Product Brand Tag", | ||
"summary": """ | ||
Manage product brand tag info into search engines indexes""", | ||
"version": "16.0.1.0.0", | ||
"license": "AGPL-3", | ||
"author": "ACSONE SA/NV", | ||
"website": "https://github.com/shopinvader/odoo-shopinvader", | ||
"depends": [ | ||
"shopinvader_search_engine_product_brand", | ||
"shopinvader_product_brand_tag", | ||
], | ||
"data": [], | ||
"demo": [], | ||
} |
Empty file.
14 changes: 14 additions & 0 deletions
14
shopinvader_search_engine_product_brand_tag/models/product_brand_tag.py
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,14 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import models | ||
|
||
|
||
class ProductBrandTag(models.Model): | ||
_inherit = "product.brand.tag" | ||
|
||
def write(self, vals): | ||
res = super(ProductBrandTag, self).write(vals) | ||
if "name" in vals: | ||
self.product_brand_ids.shopinvader_mark_to_update() | ||
return res |
7 changes: 7 additions & 0 deletions
7
shopinvader_search_engine_product_brand_tag/readme/CONTEXT.md
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,7 @@ | ||
When you manage tags on your products brand, you could want to export this information | ||
with the information related to a product brand into search engine indexes. This | ||
behavior could be achieved by using the module `shopinvader_product_brand_tag`. | ||
|
||
Nevertheless, when you update the tag name, the search engine index is not updated by | ||
default. The purpose of this module is to update the impacted records into the search | ||
engine indexes when a tag name is updated. |
1 change: 1 addition & 0 deletions
1
shopinvader_search_engine_product_brand_tag/readme/CONTRIBUTORS.md
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 @@ | ||
- Laurent Mignon <[email protected]> (https://www.acsone.eu) |
3 changes: 3 additions & 0 deletions
3
shopinvader_search_engine_product_brand_tag/readme/DESCRIPTION.md
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,3 @@ | ||
This module extends the functionality of `shopinvader_search_engine_product_brand` | ||
module to ensure that when a tag name is updated, this change is applied into the search | ||
engine indexes. |
Binary file added
BIN
+9.23 KB
shopinvader_search_engine_product_brand_tag/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 fs_product_media | ||
from . import se_backend |
26 changes: 26 additions & 0 deletions
26
shopinvader_search_engine_product_media/models/fs_product_media.py
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,26 @@ | ||
# Copyright 2023 ACSONE SA/NV | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import api, models | ||
|
||
|
||
class FsProductMedia(models.Model): | ||
_name = "fs.product.media" | ||
_inherit = ["fs.product.media", "se.product.update.mixin"] | ||
|
||
@api.model_create_multi | ||
def create(self, vals_list): | ||
res = super(FsProductMedia, self).create(vals_list) | ||
res.product_tmpl_id.shopinvader_mark_to_update() | ||
return res | ||
|
||
def write(self, vals): | ||
res = super(FsProductMedia, self).write(vals) | ||
self.mapped("product_tmpl_id").shopinvader_mark_to_update() | ||
return res | ||
|
||
def unlink(self): | ||
products = self.mapped("product_tmpl_id") | ||
res = super(FsProductMedia, self).unlink() | ||
products.shopinvader_mark_to_update() | ||
return res |