odoo13-addon-shopinvader-wishlist 13.0.3.4.2.dev1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. odoo/addons/shopinvader_wishlist/README.rst +69 -0
  2. odoo/addons/shopinvader_wishlist/__init__.py +4 -0
  3. odoo/addons/shopinvader_wishlist/__manifest__.py +15 -0
  4. odoo/addons/shopinvader_wishlist/components/__init__.py +1 -0
  5. odoo/addons/shopinvader_wishlist/components/access_info.py +20 -0
  6. odoo/addons/shopinvader_wishlist/demo/product_set.xml +17 -0
  7. odoo/addons/shopinvader_wishlist/i18n/shopinvader_wishlist.pot +66 -0
  8. odoo/addons/shopinvader_wishlist/models/__init__.py +1 -0
  9. odoo/addons/shopinvader_wishlist/models/product_set.py +80 -0
  10. odoo/addons/shopinvader_wishlist/readme/CONTRIBUTORS.rst +2 -0
  11. odoo/addons/shopinvader_wishlist/readme/CREDITS.rst +4 -0
  12. odoo/addons/shopinvader_wishlist/readme/DESCRIPTION.rst +1 -0
  13. odoo/addons/shopinvader_wishlist/services/__init__.py +1 -0
  14. odoo/addons/shopinvader_wishlist/services/wishlist.py +550 -0
  15. odoo/addons/shopinvader_wishlist/static/description/icon.png +0 -0
  16. odoo/addons/shopinvader_wishlist/static/description/index.html +426 -0
  17. odoo/addons/shopinvader_wishlist/tests/__init__.py +2 -0
  18. odoo/addons/shopinvader_wishlist/tests/test_product_set.py +119 -0
  19. odoo/addons/shopinvader_wishlist/tests/test_wishlist.py +368 -0
  20. odoo/addons/shopinvader_wishlist/views/product_set.xml +15 -0
  21. odoo/addons/shopinvader_wishlist/wizard/__init__.py +1 -0
  22. odoo/addons/shopinvader_wishlist/wizard/product_set_add.py +24 -0
  23. odoo/addons/shopinvader_wishlist/wizard/product_set_add.xml +13 -0
  24. odoo13_addon_shopinvader_wishlist-13.0.3.4.2.dev1.dist-info/METADATA +86 -0
  25. odoo13_addon_shopinvader_wishlist-13.0.3.4.2.dev1.dist-info/RECORD +27 -0
  26. odoo13_addon_shopinvader_wishlist-13.0.3.4.2.dev1.dist-info/WHEEL +5 -0
  27. odoo13_addon_shopinvader_wishlist-13.0.3.4.2.dev1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,426 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6
+ <title>Shopinvader Wishlist</title>
7
+ <style type="text/css">
8
+
9
+ /*
10
+ :Author: David Goodger (goodger@python.org)
11
+ :Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
12
+ :Copyright: This stylesheet has been placed in the public domain.
13
+
14
+ Default cascading style sheet for the HTML output of Docutils.
15
+ Despite the name, some widely supported CSS2 features are used.
16
+
17
+ See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
18
+ customize this style sheet.
19
+ */
20
+
21
+ /* used to remove borders from tables and images */
22
+ .borderless, table.borderless td, table.borderless th {
23
+ border: 0 }
24
+
25
+ table.borderless td, table.borderless th {
26
+ /* Override padding for "table.docutils td" with "! important".
27
+ The right padding separates the table cells. */
28
+ padding: 0 0.5em 0 0 ! important }
29
+
30
+ .first {
31
+ /* Override more specific margin styles with "! important". */
32
+ margin-top: 0 ! important }
33
+
34
+ .last, .with-subtitle {
35
+ margin-bottom: 0 ! important }
36
+
37
+ .hidden {
38
+ display: none }
39
+
40
+ .subscript {
41
+ vertical-align: sub;
42
+ font-size: smaller }
43
+
44
+ .superscript {
45
+ vertical-align: super;
46
+ font-size: smaller }
47
+
48
+ a.toc-backref {
49
+ text-decoration: none ;
50
+ color: black }
51
+
52
+ blockquote.epigraph {
53
+ margin: 2em 5em ; }
54
+
55
+ dl.docutils dd {
56
+ margin-bottom: 0.5em }
57
+
58
+ object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
59
+ overflow: hidden;
60
+ }
61
+
62
+ /* Uncomment (and remove this text!) to get bold-faced definition list terms
63
+ dl.docutils dt {
64
+ font-weight: bold }
65
+ */
66
+
67
+ div.abstract {
68
+ margin: 2em 5em }
69
+
70
+ div.abstract p.topic-title {
71
+ font-weight: bold ;
72
+ text-align: center }
73
+
74
+ div.admonition, div.attention, div.caution, div.danger, div.error,
75
+ div.hint, div.important, div.note, div.tip, div.warning {
76
+ margin: 2em ;
77
+ border: medium outset ;
78
+ padding: 1em }
79
+
80
+ div.admonition p.admonition-title, div.hint p.admonition-title,
81
+ div.important p.admonition-title, div.note p.admonition-title,
82
+ div.tip p.admonition-title {
83
+ font-weight: bold ;
84
+ font-family: sans-serif }
85
+
86
+ div.attention p.admonition-title, div.caution p.admonition-title,
87
+ div.danger p.admonition-title, div.error p.admonition-title,
88
+ div.warning p.admonition-title, .code .error {
89
+ color: red ;
90
+ font-weight: bold ;
91
+ font-family: sans-serif }
92
+
93
+ /* Uncomment (and remove this text!) to get reduced vertical space in
94
+ compound paragraphs.
95
+ div.compound .compound-first, div.compound .compound-middle {
96
+ margin-bottom: 0.5em }
97
+
98
+ div.compound .compound-last, div.compound .compound-middle {
99
+ margin-top: 0.5em }
100
+ */
101
+
102
+ div.dedication {
103
+ margin: 2em 5em ;
104
+ text-align: center ;
105
+ font-style: italic }
106
+
107
+ div.dedication p.topic-title {
108
+ font-weight: bold ;
109
+ font-style: normal }
110
+
111
+ div.figure {
112
+ margin-left: 2em ;
113
+ margin-right: 2em }
114
+
115
+ div.footer, div.header {
116
+ clear: both;
117
+ font-size: smaller }
118
+
119
+ div.line-block {
120
+ display: block ;
121
+ margin-top: 1em ;
122
+ margin-bottom: 1em }
123
+
124
+ div.line-block div.line-block {
125
+ margin-top: 0 ;
126
+ margin-bottom: 0 ;
127
+ margin-left: 1.5em }
128
+
129
+ div.sidebar {
130
+ margin: 0 0 0.5em 1em ;
131
+ border: medium outset ;
132
+ padding: 1em ;
133
+ background-color: #ffffee ;
134
+ width: 40% ;
135
+ float: right ;
136
+ clear: right }
137
+
138
+ div.sidebar p.rubric {
139
+ font-family: sans-serif ;
140
+ font-size: medium }
141
+
142
+ div.system-messages {
143
+ margin: 5em }
144
+
145
+ div.system-messages h1 {
146
+ color: red }
147
+
148
+ div.system-message {
149
+ border: medium outset ;
150
+ padding: 1em }
151
+
152
+ div.system-message p.system-message-title {
153
+ color: red ;
154
+ font-weight: bold }
155
+
156
+ div.topic {
157
+ margin: 2em }
158
+
159
+ h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
160
+ h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
161
+ margin-top: 0.4em }
162
+
163
+ h1.title {
164
+ text-align: center }
165
+
166
+ h2.subtitle {
167
+ text-align: center }
168
+
169
+ hr.docutils {
170
+ width: 75% }
171
+
172
+ img.align-left, .figure.align-left, object.align-left, table.align-left {
173
+ clear: left ;
174
+ float: left ;
175
+ margin-right: 1em }
176
+
177
+ img.align-right, .figure.align-right, object.align-right, table.align-right {
178
+ clear: right ;
179
+ float: right ;
180
+ margin-left: 1em }
181
+
182
+ img.align-center, .figure.align-center, object.align-center {
183
+ display: block;
184
+ margin-left: auto;
185
+ margin-right: auto;
186
+ }
187
+
188
+ table.align-center {
189
+ margin-left: auto;
190
+ margin-right: auto;
191
+ }
192
+
193
+ .align-left {
194
+ text-align: left }
195
+
196
+ .align-center {
197
+ clear: both ;
198
+ text-align: center }
199
+
200
+ .align-right {
201
+ text-align: right }
202
+
203
+ /* reset inner alignment in figures */
204
+ div.align-right {
205
+ text-align: inherit }
206
+
207
+ /* div.align-center * { */
208
+ /* text-align: left } */
209
+
210
+ .align-top {
211
+ vertical-align: top }
212
+
213
+ .align-middle {
214
+ vertical-align: middle }
215
+
216
+ .align-bottom {
217
+ vertical-align: bottom }
218
+
219
+ ol.simple, ul.simple {
220
+ margin-bottom: 1em }
221
+
222
+ ol.arabic {
223
+ list-style: decimal }
224
+
225
+ ol.loweralpha {
226
+ list-style: lower-alpha }
227
+
228
+ ol.upperalpha {
229
+ list-style: upper-alpha }
230
+
231
+ ol.lowerroman {
232
+ list-style: lower-roman }
233
+
234
+ ol.upperroman {
235
+ list-style: upper-roman }
236
+
237
+ p.attribution {
238
+ text-align: right ;
239
+ margin-left: 50% }
240
+
241
+ p.caption {
242
+ font-style: italic }
243
+
244
+ p.credits {
245
+ font-style: italic ;
246
+ font-size: smaller }
247
+
248
+ p.label {
249
+ white-space: nowrap }
250
+
251
+ p.rubric {
252
+ font-weight: bold ;
253
+ font-size: larger ;
254
+ color: maroon ;
255
+ text-align: center }
256
+
257
+ p.sidebar-title {
258
+ font-family: sans-serif ;
259
+ font-weight: bold ;
260
+ font-size: larger }
261
+
262
+ p.sidebar-subtitle {
263
+ font-family: sans-serif ;
264
+ font-weight: bold }
265
+
266
+ p.topic-title {
267
+ font-weight: bold }
268
+
269
+ pre.address {
270
+ margin-bottom: 0 ;
271
+ margin-top: 0 ;
272
+ font: inherit }
273
+
274
+ pre.literal-block, pre.doctest-block, pre.math, pre.code {
275
+ margin-left: 2em ;
276
+ margin-right: 2em }
277
+
278
+ pre.code .ln { color: gray; } /* line numbers */
279
+ pre.code, code { background-color: #eeeeee }
280
+ pre.code .comment, code .comment { color: #5C6576 }
281
+ pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
282
+ pre.code .literal.string, code .literal.string { color: #0C5404 }
283
+ pre.code .name.builtin, code .name.builtin { color: #352B84 }
284
+ pre.code .deleted, code .deleted { background-color: #DEB0A1}
285
+ pre.code .inserted, code .inserted { background-color: #A3D289}
286
+
287
+ span.classifier {
288
+ font-family: sans-serif ;
289
+ font-style: oblique }
290
+
291
+ span.classifier-delimiter {
292
+ font-family: sans-serif ;
293
+ font-weight: bold }
294
+
295
+ span.interpreted {
296
+ font-family: sans-serif }
297
+
298
+ span.option {
299
+ white-space: nowrap }
300
+
301
+ span.pre {
302
+ white-space: pre }
303
+
304
+ span.problematic, pre.problematic {
305
+ color: red }
306
+
307
+ span.section-subtitle {
308
+ /* font-size relative to parent (h1..h6 element) */
309
+ font-size: 80% }
310
+
311
+ table.citation {
312
+ border-left: solid 1px gray;
313
+ margin-left: 1px }
314
+
315
+ table.docinfo {
316
+ margin: 2em 4em }
317
+
318
+ table.docutils {
319
+ margin-top: 0.5em ;
320
+ margin-bottom: 0.5em }
321
+
322
+ table.footnote {
323
+ border-left: solid 1px black;
324
+ margin-left: 1px }
325
+
326
+ table.docutils td, table.docutils th,
327
+ table.docinfo td, table.docinfo th {
328
+ padding-left: 0.5em ;
329
+ padding-right: 0.5em ;
330
+ vertical-align: top }
331
+
332
+ table.docutils th.field-name, table.docinfo th.docinfo-name {
333
+ font-weight: bold ;
334
+ text-align: left ;
335
+ white-space: nowrap ;
336
+ padding-left: 0 }
337
+
338
+ /* "booktabs" style (no vertical lines) */
339
+ table.docutils.booktabs {
340
+ border: 0px;
341
+ border-top: 2px solid;
342
+ border-bottom: 2px solid;
343
+ border-collapse: collapse;
344
+ }
345
+ table.docutils.booktabs * {
346
+ border: 0px;
347
+ }
348
+ table.docutils.booktabs th {
349
+ border-bottom: thin solid;
350
+ text-align: left;
351
+ }
352
+
353
+ h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
354
+ h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
355
+ font-size: 100% }
356
+
357
+ ul.auto-toc {
358
+ list-style-type: none }
359
+
360
+ </style>
361
+ </head>
362
+ <body>
363
+ <div class="document" id="shopinvader-wishlist">
364
+ <h1 class="title">Shopinvader Wishlist</h1>
365
+
366
+ <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367
+ !! This file is generated by oca-gen-addon-readme !!
368
+ !! changes will be overwritten. !!
369
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
+ !! source digest: sha256:659f1a86278f41835a64306a7c85a95392ac9cf2852287596fdcd52019c888ea
371
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
+ <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/shopinvader/odoo-shopinvader/tree/13.0/shopinvader_wishlist"><img alt="shopinvader/odoo-shopinvader" src="https://img.shields.io/badge/github-shopinvader%2Fodoo--shopinvader-lightgray.png?logo=github" /></a></p>
373
+ <p>Expose wishlist features for Shopinvader websites.</p>
374
+ <p><strong>Table of contents</strong></p>
375
+ <div class="contents local topic" id="contents">
376
+ <ul class="simple">
377
+ <li><a class="reference internal" href="#bug-tracker" id="toc-entry-1">Bug Tracker</a></li>
378
+ <li><a class="reference internal" href="#credits" id="toc-entry-2">Credits</a><ul>
379
+ <li><a class="reference internal" href="#authors" id="toc-entry-3">Authors</a></li>
380
+ <li><a class="reference internal" href="#contributors" id="toc-entry-4">Contributors</a></li>
381
+ <li><a class="reference internal" href="#other-credits" id="toc-entry-5">Other credits</a></li>
382
+ <li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
383
+ </ul>
384
+ </li>
385
+ </ul>
386
+ </div>
387
+ <div class="section" id="bug-tracker">
388
+ <h1><a class="toc-backref" href="#toc-entry-1">Bug Tracker</a></h1>
389
+ <p>Bugs are tracked on <a class="reference external" href="https://github.com/shopinvader/odoo-shopinvader/issues">GitHub Issues</a>.
390
+ In case of trouble, please check there if your issue has already been reported.
391
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
392
+ <a class="reference external" href="https://github.com/shopinvader/odoo-shopinvader/issues/new?body=module:%20shopinvader_wishlist%0Aversion:%2013.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
393
+ <p>Do not contact contributors directly about support or help with technical issues.</p>
394
+ </div>
395
+ <div class="section" id="credits">
396
+ <h1><a class="toc-backref" href="#toc-entry-2">Credits</a></h1>
397
+ <div class="section" id="authors">
398
+ <h2><a class="toc-backref" href="#toc-entry-3">Authors</a></h2>
399
+ <ul class="simple">
400
+ <li>Camptocamp</li>
401
+ </ul>
402
+ </div>
403
+ <div class="section" id="contributors">
404
+ <h2><a class="toc-backref" href="#toc-entry-4">Contributors</a></h2>
405
+ <ul class="simple">
406
+ <li>Simone Orsi &lt;<a class="reference external" href="mailto:simone.orsi&#64;camptocamp.com">simone.orsi&#64;camptocamp.com</a>&gt;</li>
407
+ <li>Laurent Mignon &lt;<a class="reference external" href="mailto:laurent.mignon&#64;acsone.com">laurent.mignon&#64;acsone.com</a>&gt;</li>
408
+ </ul>
409
+ </div>
410
+ <div class="section" id="other-credits">
411
+ <h2><a class="toc-backref" href="#toc-entry-5">Other credits</a></h2>
412
+ <p>The development of this module has been financially supported by:</p>
413
+ <ul class="simple">
414
+ <li>Camptocamp</li>
415
+ <li>Cosanum</li>
416
+ </ul>
417
+ </div>
418
+ <div class="section" id="maintainers">
419
+ <h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
420
+ <p>This module is part of the <a class="reference external" href="https://github.com/shopinvader/odoo-shopinvader/tree/13.0/shopinvader_wishlist">shopinvader/odoo-shopinvader</a> project on GitHub.</p>
421
+ <p>You are welcome to contribute.</p>
422
+ </div>
423
+ </div>
424
+ </div>
425
+ </body>
426
+ </html>
@@ -0,0 +1,2 @@
1
+ from . import test_product_set
2
+ from . import test_wishlist
@@ -0,0 +1,119 @@
1
+ # Copyright 2019 Camptocamp (http://www.camptocamp.com).
2
+ # @author Simone Orsi <simone.orsi@camptocamp.com>
3
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
4
+
5
+ from odoo import exceptions
6
+ from odoo.tools import mute_logger
7
+
8
+ from odoo.addons.shopinvader.tests.common import CommonCase
9
+
10
+
11
+ class ProductSet(CommonCase):
12
+ @classmethod
13
+ def setUpClass(cls):
14
+ super(ProductSet, cls).setUpClass()
15
+ cls.prod_set = cls.env.ref("shopinvader_wishlist.wishlist_1")
16
+ cls.prod_set.shopinvader_backend_id = cls.backend
17
+
18
+ def test_create_no_variant(self):
19
+ # ensure we can create a line from the product and we get the variant
20
+ prod = self.env.ref("product.product_product_4b")
21
+ line = self.prod_set.set_line_ids.create(
22
+ {
23
+ "product_set_id": self.prod_set.id,
24
+ "product_id": prod.id,
25
+ "quantity": 1,
26
+ }
27
+ )
28
+ variant = prod.shopinvader_bind_ids[0]
29
+ self.assertEqual(line.shopinvader_variant_id, variant)
30
+ self.assertEqual(variant.lang_id.code, "en_US")
31
+
32
+ def test_archived_product(self):
33
+ # ensure product archived is visible
34
+ prod = self.env.ref("product.product_product_4d")
35
+ line = self.prod_set.set_line_ids.create(
36
+ {
37
+ "product_set_id": self.prod_set.id,
38
+ "product_id": prod.id,
39
+ "quantity": 1,
40
+ }
41
+ )
42
+ variant = prod.shopinvader_bind_ids[0]
43
+ variant.active = False
44
+ line.invalidate_cache(["shopinvader_variant_id"])
45
+ self.assertEqual(line.shopinvader_variant_id, variant)
46
+
47
+ @mute_logger("odoo.models.unlink")
48
+ def test_create_no_variant_switch_lang(self):
49
+ lang_fr = self._install_lang("base.lang_fr")
50
+ self.backend.lang_ids |= lang_fr
51
+ self.prod_set.partner_id.lang = lang_fr.code
52
+ # ensure we can create a line from the product and we get the variant
53
+ prod = self.env.ref("product.product_product_4b")
54
+ self._bind_products(prod)
55
+ line = self.prod_set.set_line_ids.create(
56
+ {
57
+ "product_set_id": self.prod_set.id,
58
+ "product_id": prod.id,
59
+ "quantity": 1,
60
+ }
61
+ )
62
+ # test it w/ multi lang
63
+ variant_en = prod._get_invader_variant(self.backend, "en_US")
64
+ variant_fr = prod._get_invader_variant(self.backend, "fr_FR")
65
+ self.assertEqual(
66
+ line.with_context(lang="en_US").shopinvader_variant_id, variant_en
67
+ )
68
+ self.assertEqual(
69
+ line.with_context(lang="fr_FR").shopinvader_variant_id, variant_fr
70
+ )
71
+ # delete variant, fallback to the one matching partner lang
72
+ variant_en.unlink()
73
+ self.assertEqual(
74
+ line.with_context(lang="en_US").shopinvader_variant_id, variant_fr
75
+ )
76
+
77
+ def test_get_lines_by_products(self):
78
+ # ensure we can create a line from the product and we get the variant
79
+ prod = self.env.ref("product.product_product_4d")
80
+ line = self.prod_set.set_line_ids.create(
81
+ {
82
+ "product_set_id": self.prod_set.id,
83
+ "product_id": prod.id,
84
+ "quantity": 1,
85
+ }
86
+ )
87
+ variant = prod.shopinvader_bind_ids[0]
88
+ self.assertEqual(
89
+ self.prod_set.get_lines_by_products(
90
+ invader_variant_ids=variant.ids
91
+ ),
92
+ line,
93
+ )
94
+ self.assertEqual(
95
+ self.prod_set.get_lines_by_products(product_ids=prod.ids), line
96
+ )
97
+ with self.assertRaises(exceptions.ValidationError):
98
+ self.prod_set.get_lines_by_products()
99
+
100
+ def test_get_line_by_product_backward_compat(self):
101
+ # ensure old method `get_line_by_product` works
102
+ prod = self.env.ref("product.product_product_4d")
103
+ line = self.prod_set.set_line_ids.create(
104
+ {
105
+ "product_set_id": self.prod_set.id,
106
+ "product_id": prod.id,
107
+ "quantity": 1,
108
+ }
109
+ )
110
+ variant = prod.shopinvader_bind_ids[0]
111
+ self.assertEqual(
112
+ self.prod_set.get_line_by_product(invader_variant_id=variant.id),
113
+ line,
114
+ )
115
+ self.assertEqual(
116
+ self.prod_set.get_line_by_product(product_id=prod.id), line
117
+ )
118
+ with self.assertRaises(exceptions.ValidationError):
119
+ self.prod_set.get_line_by_product()