-
-
Notifications
You must be signed in to change notification settings - Fork 500
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] product_variant_multi_link: Migration to 18.0
- Loading branch information
1 parent
504d5c7
commit 0c1427e
Showing
9 changed files
with
30 additions
and
12 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 |
---|---|---|
|
@@ -63,6 +63,7 @@ Contributors | |
------------ | ||
|
||
- Simone Orsi <[email protected]> | ||
- Thien Vo <[email protected]> | ||
|
||
Other credits | ||
------------- | ||
|
@@ -72,6 +73,9 @@ The development of this module has been financially supported by: | |
- Camptocamp | ||
- Cosanum | ||
|
||
The migration of this module from 14.0 to 18.0 was financially supported | ||
by Camptocamp. | ||
|
||
Maintainers | ||
----------- | ||
|
||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# Simone Orsi <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import _, api, fields, models | ||
from odoo import api, fields, models | ||
from odoo.exceptions import AccessError | ||
|
||
|
||
|
@@ -24,7 +24,7 @@ def _compute_product_product_link_count(self): | |
link_model = self.env["product.template.link"] | ||
# Set product_template_link_qty to 0 if user has no access on the model | ||
try: | ||
link_model.check_access_rights("read") | ||
link_model.check_access("read") | ||
except AccessError: | ||
self.update({"product_product_link_count": 0}) | ||
return | ||
|
@@ -72,9 +72,9 @@ def show_product_product_links(self): | |
self.ensure_one() | ||
|
||
return { | ||
"name": _("Product links"), | ||
"name": self.env._("Product links"), | ||
"type": "ir.actions.act_window", | ||
"view_mode": "tree,form", | ||
"view_mode": "list,form", | ||
"res_model": "product.template.link", | ||
"domain": [ | ||
"|", | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
# Simone Orsi <[email protected]> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from odoo import _, api, exceptions, fields, models | ||
from odoo import api, exceptions, fields, models | ||
|
||
|
||
class ProductTemplateLink(models.Model): | ||
|
@@ -37,9 +37,9 @@ def _check_products(self): | |
# to avoid issues w/ existing table and existing records | ||
if not rec.left_product_id or not rec.right_product_id: | ||
raise exceptions.ValidationError( | ||
_("Source and target variants are required!") | ||
self.env._("Source and target variants are required!") | ||
) | ||
super()._check_products() | ||
return super()._check_products() | ||
|
||
def _check_product_not_different(self): | ||
res = super()._check_product_not_different() | ||
|
@@ -62,5 +62,6 @@ def _check_products_query_params(self): | |
return params | ||
|
||
def _invalidate_links(self): | ||
super()._invalidate_links() | ||
self.env["product.product"].invalidate_cache(["product_variant_link_ids"]) | ||
res = super()._invalidate_links() | ||
self.env["product.product"].invalidate_model(["product_variant_link_ids"]) | ||
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 |
---|---|---|
@@ -1 +1,2 @@ | ||
- Simone Orsi \<<[email protected]>\> | ||
- Thien Vo \<<[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
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