Skip to content

Commit 8653f20

Browse files
committed
Add shopinvader_product_variant_multi_link
1 parent 13f64a7 commit 8653f20

File tree

11 files changed

+615
-0
lines changed

11 files changed

+615
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
================================
2+
Shopinvader Product Variant Link
3+
================================
4+
5+
.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6+
!! This file is generated by oca-gen-addon-readme !!
7+
!! changes will be overwritten. !!
8+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
9+
10+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
11+
:target: https://odoo-community.org/page/development-status
12+
:alt: Beta
13+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
14+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
15+
:alt: License: AGPL-3
16+
.. |badge3| image:: https://img.shields.io/badge/github-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github
17+
:target: https://github.com/shopinvader/odoo-shopinvader/tree/13.0/shopinvader_product_variant_multi_link
18+
:alt: shopinvader/odoo-shopinvader
19+
20+
|badge1| |badge2| |badge3|
21+
22+
Integrate `product_variant_multi_link` into Shopinvader.
23+
This module takes care of computing product links data
24+
for search engine product indexes.
25+
Index data is computed as a mapping of variants by link type.
26+
27+
**Table of contents**
28+
29+
.. contents::
30+
:local:
31+
32+
Bug Tracker
33+
===========
34+
35+
Bugs are tracked on `GitHub Issues <https://github.com/shopinvader/odoo-shopinvader/issues>`_.
36+
In case of trouble, please check there if your issue has already been reported.
37+
If you spotted it first, help us smashing it by providing a detailed and welcomed
38+
`feedback <https://github.com/shopinvader/odoo-shopinvader/issues/new?body=module:%20shopinvader_product_variant_multi_link%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
39+
40+
Do not contact contributors directly about support or help with technical issues.
41+
42+
Credits
43+
=======
44+
45+
Authors
46+
~~~~~~~
47+
48+
* Camptocamp
49+
50+
Contributors
51+
~~~~~~~~~~~~
52+
53+
* Simone Orsi <simahawk@gmail.com>
54+
55+
Other credits
56+
~~~~~~~~~~~~~
57+
58+
The development of this module has been financially supported by:
59+
60+
* Camptocamp
61+
* Cosanum
62+
63+
Maintainers
64+
~~~~~~~~~~~
65+
66+
This module is part of the `shopinvader/odoo-shopinvader <https://github.com/shopinvader/odoo-shopinvader/tree/13.0/shopinvader_product_variant_multi_link>`_ project on GitHub.
67+
68+
You are welcome to contribute.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import models
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (C) 2020 (http://www.camptocamp.com)
2+
# @author Simone Orsi <simahawk@gmail.com>
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
4+
{
5+
"name": "Shopinvader Product Variant Link",
6+
"summary": "Integrate product_variant_multi_link with Shopinvader",
7+
"version": "13.0.1.0.0",
8+
"category": "e-commerce",
9+
"website": "https://shopinvader.com",
10+
"author": "Camptocamp",
11+
"license": "AGPL-3",
12+
"installable": True,
13+
"auto_install": True,
14+
"depends": [
15+
"shopinvader_product_template_multi_link",
16+
"product_variant_multi_link",
17+
],
18+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from . import shopinvader_variant
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (C) 2020 (http://www.camptocamp.com)
2+
# @author Simone Orsi <simahawk@gmail.com>
3+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
4+
5+
from odoo import models
6+
7+
8+
class ShopinvaderVariant(models.Model):
9+
_name = "shopinvader.variant"
10+
_inherit = ["shopinvader.variant", "shopinvader.product.link.mixin"]
11+
12+
def _get_product_links(self):
13+
return self.product_variant_link_ids
14+
15+
def _product_link_target(self, link):
16+
if link.left_product_id != self.record_id:
17+
return link.left_product_id
18+
else:
19+
return link.right_product_id
20+
21+
def _product_link_target_variant(self, target):
22+
return target._get_invader_variant(self.backend_id, self.lang_id.code)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* Simone Orsi <simahawk@gmail.com>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The development of this module has been financially supported by:
2+
3+
* Camptocamp
4+
* Cosanum
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Integrate `product_variant_multi_link` into Shopinvader.
2+
This module takes care of computing product links data
3+
for search engine product indexes.
4+
Index data is computed as a mapping of variants by link type.

0 commit comments

Comments
 (0)