odoo-addon-base-tier-validation 16.0.2.6.0.1__py3-none-any.whl → 16.0.3.0.0__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.
@@ -1,3 +1,7 @@
1
+ .. image:: https://odoo-community.org/readme-banner-image
2
+ :target: https://odoo-community.org/get-involved?utm_source=readme
3
+ :alt: Odoo Community Association
4
+
1
5
  ====================
2
6
  Base Tier Validation
3
7
  ====================
@@ -7,13 +11,13 @@ Base Tier Validation
7
11
  !! This file is generated by oca-gen-addon-readme !!
8
12
  !! changes will be overwritten. !!
9
13
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
- !! source digest: sha256:8e99bb2b477c5c3a3ce8a49b2f854341131b246b0a7b1ea30c4e04acf1dbeaec
14
+ !! source digest: sha256:f3093af0e62d45b3f67e36b93c79f6b5a0ba627d57ae5c78d3242c7df5f1deac
11
15
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
16
 
13
17
  .. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
14
18
  :target: https://odoo-community.org/page/development-status
15
19
  :alt: Mature
16
- .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
20
+ .. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
17
21
  :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18
22
  :alt: License: AGPL-3
19
23
  .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github
@@ -3,7 +3,7 @@
3
3
  {
4
4
  "name": "Base Tier Validation",
5
5
  "summary": "Implement a validation process based on tiers.",
6
- "version": "16.0.2.6.0",
6
+ "version": "16.0.3.0.0",
7
7
  "development_status": "Mature",
8
8
  "maintainers": ["LoisRForgeFlow"],
9
9
  "category": "Tools",
@@ -6,7 +6,7 @@
6
6
  forcecreate="1"
7
7
  >
8
8
  <field name="name">Tier Validation Requested</field>
9
- <field name="default" eval="True" />
9
+ <field name="default" eval="False" />
10
10
  <field name="internal" eval="True" />
11
11
  <field name="hidden" eval="True" />
12
12
  </record>
@@ -16,7 +16,7 @@
16
16
  forcecreate="1"
17
17
  >
18
18
  <field name="name">Tier Validation Accepted Notification</field>
19
- <field name="default" eval="True" />
19
+ <field name="default" eval="False" />
20
20
  <field name="internal" eval="True" />
21
21
  <field name="hidden" eval="True" />
22
22
  </record>
@@ -26,7 +26,7 @@
26
26
  forcecreate="1"
27
27
  >
28
28
  <field name="name">Tier Validation Rejected Notification</field>
29
- <field name="default" eval="True" />
29
+ <field name="default" eval="False" />
30
30
  <field name="internal" eval="True" />
31
31
  <field name="hidden" eval="True" />
32
32
  </record>
@@ -36,7 +36,7 @@
36
36
  forcecreate="1"
37
37
  >
38
38
  <field name="name">Tier Validation Restarted</field>
39
- <field name="default" eval="True" />
39
+ <field name="default" eval="False" />
40
40
  <field name="internal" eval="True" />
41
41
  <field name="hidden" eval="True" />
42
42
  </record>
@@ -479,13 +479,29 @@ class TierValidation(models.AbstractModel):
479
479
  reviews_to_notify = user_reviews.filtered(
480
480
  lambda r: r.definition_id.notify_on_accepted
481
481
  )
482
+ # We need to notify all pending users if there is approve sequence
483
+ if tier_reviews and any(review.approve_sequence for review in tier_reviews):
484
+ reviews_to_notify = self.review_ids.filtered(
485
+ lambda r: r.status == "pending" and r.definition_id.notify_on_accepted
486
+ )
487
+ # If there are approve sequence, only the following should be
488
+ # considered to notify
489
+ if reviews_to_notify and any(
490
+ review.approve_sequence for review in reviews_to_notify
491
+ ):
492
+ reviews_to_notify = reviews_to_notify.filtered(
493
+ lambda x: x.approve_sequence
494
+ )[0]
482
495
  if reviews_to_notify:
483
496
  subscribe = "message_subscribe"
484
497
  if hasattr(self, subscribe):
485
498
  getattr(self, subscribe)(
486
499
  partner_ids=reviews_to_notify.mapped("reviewer_ids")
487
500
  .mapped("partner_id")
488
- .ids
501
+ .ids,
502
+ subtype_ids=self.env.ref(
503
+ self._get_accepted_notification_subtype()
504
+ ).ids,
489
505
  )
490
506
  for review in reviews_to_notify:
491
507
  rec = self.env[review.model].browse(review.res_id)
@@ -600,13 +616,29 @@ class TierValidation(models.AbstractModel):
600
616
  reviews_to_notify = user_reviews.filtered(
601
617
  lambda r: r.definition_id.notify_on_rejected
602
618
  )
619
+ # We need to notify all pending users if there is approve sequence
620
+ if tier_reviews and any(review.approve_sequence for review in tier_reviews):
621
+ reviews_to_notify = self.review_ids.filtered(
622
+ lambda r: r.status == "pending" and r.definition_id.notify_on_rejected
623
+ )
624
+ # If there are approve sequence, only the following should be
625
+ # considered to notify
626
+ if reviews_to_notify and any(
627
+ review.approve_sequence for review in reviews_to_notify
628
+ ):
629
+ reviews_to_notify = reviews_to_notify.filtered(
630
+ lambda x: x.approve_sequence
631
+ )[0]
603
632
  if reviews_to_notify:
604
633
  subscribe = "message_subscribe"
605
634
  if hasattr(self, subscribe):
606
635
  getattr(self, subscribe)(
607
636
  partner_ids=reviews_to_notify.mapped("reviewer_ids")
608
637
  .mapped("partner_id")
609
- .ids
638
+ .ids,
639
+ subtype_ids=self.env.ref(
640
+ self._get_rejected_notification_subtype()
641
+ ).ids,
610
642
  )
611
643
  for review in reviews_to_notify:
612
644
  rec = self.env[review.model].browse(review.res_id)
@@ -626,7 +658,10 @@ class TierValidation(models.AbstractModel):
626
658
  # Subscribe reviewers and notify
627
659
  if len(users_to_notify) > 0:
628
660
  getattr(rec, subscribe)(
629
- partner_ids=users_to_notify.mapped("partner_id").ids
661
+ partner_ids=users_to_notify.mapped("partner_id").ids,
662
+ subtype_ids=self.env.ref(
663
+ self._get_requested_notification_subtype()
664
+ ).ids,
630
665
  )
631
666
  getattr(rec, post)(
632
667
  subtype_xmlid=self._get_requested_notification_subtype(),
@@ -716,7 +751,12 @@ class TierValidation(models.AbstractModel):
716
751
  lambda r: r.definition_id.notify_on_restarted
717
752
  )
718
753
  if hasattr(self, subscribe):
719
- getattr(self, subscribe)(partner_ids=partners_to_notify_ids)
754
+ getattr(self, subscribe)(
755
+ partner_ids=partners_to_notify_ids,
756
+ subtype_ids=self.env.ref(
757
+ self._get_restarted_notification_subtype()
758
+ ).ids,
759
+ )
720
760
  rec._notify_restarted_review()
721
761
 
722
762
  def reevaluate_reviews(self):
@@ -3,7 +3,7 @@
3
3
  <head>
4
4
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
5
  <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6
- <title>Base Tier Validation</title>
6
+ <title>README.rst</title>
7
7
  <style type="text/css">
8
8
 
9
9
  /*
@@ -360,16 +360,21 @@ ul.auto-toc {
360
360
  </style>
361
361
  </head>
362
362
  <body>
363
- <div class="document" id="base-tier-validation">
364
- <h1 class="title">Base Tier Validation</h1>
363
+ <div class="document">
365
364
 
365
+
366
+ <a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367
+ <img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368
+ </a>
369
+ <div class="section" id="base-tier-validation">
370
+ <h1>Base Tier Validation</h1>
366
371
  <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
367
372
  !! This file is generated by oca-gen-addon-readme !!
368
373
  !! changes will be overwritten. !!
369
374
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
370
- !! source digest: sha256:8e99bb2b477c5c3a3ce8a49b2f854341131b246b0a7b1ea30c4e04acf1dbeaec
375
+ !! source digest: sha256:f3093af0e62d45b3f67e36b93c79f6b5a0ba627d57ae5c78d3242c7df5f1deac
371
376
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
- <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.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/OCA/server-ux/tree/16.0/base_tier_validation"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-ux-16-0/server-ux-16-0-base_tier_validation"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-ux&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
377
+ <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Mature" src="https://img.shields.io/badge/maturity-Mature-brightgreen.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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/server-ux/tree/16.0/base_tier_validation"><img alt="OCA/server-ux" src="https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/server-ux-16-0/server-ux-16-0-base_tier_validation"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/server-ux&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
378
  <p>Validating some operations is a common need across different areas in a company
374
379
  and sometimes it also involves several people and stages in the process. With
375
380
  this module you will be able to define your custom validation workflows for
@@ -412,7 +417,7 @@ development.</p>
412
417
  </ul>
413
418
  </div>
414
419
  <div class="section" id="configuration">
415
- <h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
420
+ <h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
416
421
  <p>To configure Tier Validations, you need to:</p>
417
422
  <ol class="arabic simple">
418
423
  <li>Go to <em>Settings &gt; Technical &gt; Tier Validations &gt; Tier Definition</em>.</li>
@@ -443,7 +448,7 @@ having tier validation functionality.</li>
443
448
  </ul>
444
449
  </div>
445
450
  <div class="section" id="known-issues-roadmap">
446
- <h1><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h1>
451
+ <h2><a class="toc-backref" href="#toc-entry-2">Known issues / Roadmap</a></h2>
447
452
  <p>This is the list of known issues for this module. Any proposal for improvement will
448
453
  be very valuable.</p>
449
454
  <ul>
@@ -464,13 +469,13 @@ behavior we need to modify the value on our expected model.</p>
464
469
  </ul>
465
470
  </div>
466
471
  <div class="section" id="changelog">
467
- <h1><a class="toc-backref" href="#toc-entry-3">Changelog</a></h1>
472
+ <h2><a class="toc-backref" href="#toc-entry-3">Changelog</a></h2>
468
473
  <div class="section" id="section-1">
469
- <h2><a class="toc-backref" href="#toc-entry-4">14.0.1.0.0 (2020-11-19)</a></h2>
474
+ <h3><a class="toc-backref" href="#toc-entry-4">14.0.1.0.0 (2020-11-19)</a></h3>
470
475
  <p>Migrated to Odoo 14.</p>
471
476
  </div>
472
477
  <div class="section" id="section-2">
473
- <h2><a class="toc-backref" href="#toc-entry-5">13.0.1.2.2 (2020-08-30)</a></h2>
478
+ <h3><a class="toc-backref" href="#toc-entry-5">13.0.1.2.2 (2020-08-30)</a></h3>
474
479
  <p>Fixes:</p>
475
480
  <ul class="simple">
476
481
  <li>When using approve_sequence option in any tier.definition there can be inconsistencies in the systray notifications</li>
@@ -478,7 +483,7 @@ behavior we need to modify the value on our expected model.</p>
478
483
  </ul>
479
484
  </div>
480
485
  <div class="section" id="section-3">
481
- <h2><a class="toc-backref" href="#toc-entry-6">12.0.3.3.1 (2019-12-02)</a></h2>
486
+ <h3><a class="toc-backref" href="#toc-entry-6">12.0.3.3.1 (2019-12-02)</a></h3>
482
487
  <p>Fixes:</p>
483
488
  <ul class="simple">
484
489
  <li>Show comment on Reviews Table.</li>
@@ -486,7 +491,7 @@ behavior we need to modify the value on our expected model.</p>
486
491
  </ul>
487
492
  </div>
488
493
  <div class="section" id="section-4">
489
- <h2><a class="toc-backref" href="#toc-entry-7">12.0.3.3.0 (2019-11-27)</a></h2>
494
+ <h3><a class="toc-backref" href="#toc-entry-7">12.0.3.3.0 (2019-11-27)</a></h3>
490
495
  <p>New features:</p>
491
496
  <ul class="simple">
492
497
  <li>Add comment on Reviews Table.</li>
@@ -494,42 +499,42 @@ behavior we need to modify the value on our expected model.</p>
494
499
  </ul>
495
500
  </div>
496
501
  <div class="section" id="section-5">
497
- <h2><a class="toc-backref" href="#toc-entry-8">12.0.3.2.1 (2019-11-26)</a></h2>
502
+ <h3><a class="toc-backref" href="#toc-entry-8">12.0.3.2.1 (2019-11-26)</a></h3>
498
503
  <p>Fixes:</p>
499
504
  <ul class="simple">
500
505
  <li>Remove message_subscribe_users</li>
501
506
  </ul>
502
507
  </div>
503
508
  <div class="section" id="section-6">
504
- <h2><a class="toc-backref" href="#toc-entry-9">12.0.3.2.0 (2019-11-25)</a></h2>
509
+ <h3><a class="toc-backref" href="#toc-entry-9">12.0.3.2.0 (2019-11-25)</a></h3>
505
510
  <p>New features:</p>
506
511
  <ul class="simple">
507
512
  <li>Notify reviewers</li>
508
513
  </ul>
509
514
  </div>
510
515
  <div class="section" id="section-7">
511
- <h2><a class="toc-backref" href="#toc-entry-10">12.0.3.1.0 (2019-07-08)</a></h2>
516
+ <h3><a class="toc-backref" href="#toc-entry-10">12.0.3.1.0 (2019-07-08)</a></h3>
512
517
  <p>Fixes:</p>
513
518
  <ul class="simple">
514
519
  <li>Singleton error</li>
515
520
  </ul>
516
521
  </div>
517
522
  <div class="section" id="section-8">
518
- <h2><a class="toc-backref" href="#toc-entry-11">12.0.3.0.0 (2019-12-02)</a></h2>
523
+ <h3><a class="toc-backref" href="#toc-entry-11">12.0.3.0.0 (2019-12-02)</a></h3>
519
524
  <p>Fixes:</p>
520
525
  <ul class="simple">
521
526
  <li>Edit Reviews Table</li>
522
527
  </ul>
523
528
  </div>
524
529
  <div class="section" id="section-9">
525
- <h2><a class="toc-backref" href="#toc-entry-12">12.0.2.1.0 (2019-05-29)</a></h2>
530
+ <h3><a class="toc-backref" href="#toc-entry-12">12.0.2.1.0 (2019-05-29)</a></h3>
526
531
  <p>Fixes:</p>
527
532
  <ul class="simple">
528
533
  <li>Edit drop-down style width and position</li>
529
534
  </ul>
530
535
  </div>
531
536
  <div class="section" id="section-10">
532
- <h2><a class="toc-backref" href="#toc-entry-13">12.0.2.0.0 (2019-05-28)</a></h2>
537
+ <h3><a class="toc-backref" href="#toc-entry-13">12.0.2.0.0 (2019-05-28)</a></h3>
533
538
  <p>New features:</p>
534
539
  <ul class="simple">
535
540
  <li>Pass parameters as functions.</li>
@@ -537,24 +542,24 @@ behavior we need to modify the value on our expected model.</p>
537
542
  </ul>
538
543
  </div>
539
544
  <div class="section" id="section-11">
540
- <h2><a class="toc-backref" href="#toc-entry-14">12.0.1.0.0 (2019-02-18)</a></h2>
545
+ <h3><a class="toc-backref" href="#toc-entry-14">12.0.1.0.0 (2019-02-18)</a></h3>
541
546
  <p>Migrated to Odoo 12.</p>
542
547
  </div>
543
548
  <div class="section" id="section-12">
544
- <h2><a class="toc-backref" href="#toc-entry-15">11.0.1.0.0 (2018-05-09)</a></h2>
549
+ <h3><a class="toc-backref" href="#toc-entry-15">11.0.1.0.0 (2018-05-09)</a></h3>
545
550
  <p>Migrated to Odoo 11.</p>
546
551
  </div>
547
552
  <div class="section" id="section-13">
548
- <h2><a class="toc-backref" href="#toc-entry-16">10.0.1.0.0 (2018-03-26)</a></h2>
553
+ <h3><a class="toc-backref" href="#toc-entry-16">10.0.1.0.0 (2018-03-26)</a></h3>
549
554
  <p>Migrated to Odoo 10.</p>
550
555
  </div>
551
556
  <div class="section" id="section-14">
552
- <h2><a class="toc-backref" href="#toc-entry-17">9.0.1.0.0 (2017-12-02)</a></h2>
557
+ <h3><a class="toc-backref" href="#toc-entry-17">9.0.1.0.0 (2017-12-02)</a></h3>
553
558
  <p>First version.</p>
554
559
  </div>
555
560
  </div>
556
561
  <div class="section" id="bug-tracker">
557
- <h1><a class="toc-backref" href="#toc-entry-18">Bug Tracker</a></h1>
562
+ <h2><a class="toc-backref" href="#toc-entry-18">Bug Tracker</a></h2>
558
563
  <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/server-ux/issues">GitHub Issues</a>.
559
564
  In case of trouble, please check there if your issue has already been reported.
560
565
  If you spotted it first, help us to smash it by providing a detailed and welcomed
@@ -562,15 +567,15 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
562
567
  <p>Do not contact contributors directly about support or help with technical issues.</p>
563
568
  </div>
564
569
  <div class="section" id="credits">
565
- <h1><a class="toc-backref" href="#toc-entry-19">Credits</a></h1>
570
+ <h2><a class="toc-backref" href="#toc-entry-19">Credits</a></h2>
566
571
  <div class="section" id="authors">
567
- <h2><a class="toc-backref" href="#toc-entry-20">Authors</a></h2>
572
+ <h3><a class="toc-backref" href="#toc-entry-20">Authors</a></h3>
568
573
  <ul class="simple">
569
574
  <li>ForgeFlow</li>
570
575
  </ul>
571
576
  </div>
572
577
  <div class="section" id="contributors">
573
- <h2><a class="toc-backref" href="#toc-entry-21">Contributors</a></h2>
578
+ <h3><a class="toc-backref" href="#toc-entry-21">Contributors</a></h3>
574
579
  <ul class="simple">
575
580
  <li>Lois Rilo &lt;<a class="reference external" href="mailto:lois.rilo&#64;forgeflow.com">lois.rilo&#64;forgeflow.com</a>&gt;</li>
576
581
  <li>Naglis Jonaitis &lt;<a class="reference external" href="mailto:naglis&#64;versada.eu">naglis&#64;versada.eu</a>&gt;</li>
@@ -589,7 +594,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
589
594
  </ul>
590
595
  </div>
591
596
  <div class="section" id="maintainers">
592
- <h2><a class="toc-backref" href="#toc-entry-22">Maintainers</a></h2>
597
+ <h3><a class="toc-backref" href="#toc-entry-22">Maintainers</a></h3>
593
598
  <p>This module is maintained by the OCA.</p>
594
599
  <a class="reference external image-reference" href="https://odoo-community.org">
595
600
  <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
@@ -604,5 +609,6 @@ promote its widespread use.</p>
604
609
  </div>
605
610
  </div>
606
611
  </div>
612
+ </div>
607
613
  </body>
608
614
  </html>
@@ -2,6 +2,7 @@
2
2
  <odoo>
3
3
  <template id="tier_validation_buttons">
4
4
  <div>
5
+ <field name="validation_status" invisible="1" />
5
6
  <button
6
7
  name="request_validation"
7
8
  string="Request Validation"
@@ -1,5 +1,4 @@
1
1
  # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2
2
 
3
- from . import common
4
3
  from . import test_tier_validation
5
4
  from . import test_tier_validation_reminder
@@ -1050,6 +1050,159 @@ class TierTierValidation(CommonTierValidation):
1050
1050
 
1051
1051
  self.assertEqual(len(reviews), 2)
1052
1052
 
1053
+ def test_30_request_validation(self):
1054
+ # Create new test record
1055
+ test_record = self.test_model.create({"test_field": 2.5})
1056
+ # Create tier definitions for both tester models
1057
+ self.tier_definition.write(
1058
+ {
1059
+ "approve_sequence": True,
1060
+ "notify_on_create": True,
1061
+ }
1062
+ )
1063
+ def_2 = self.tier_def_obj.create(
1064
+ {
1065
+ "model_id": self.tester_model.id,
1066
+ "review_type": "individual",
1067
+ "reviewer_id": self.test_user_2.id,
1068
+ "sequence": 20,
1069
+ "approve_sequence": True,
1070
+ "notify_on_create": False,
1071
+ "notify_on_accepted": True,
1072
+ }
1073
+ )
1074
+ def_3 = self.tier_def_obj.create(
1075
+ {
1076
+ "model_id": self.tester_model.id,
1077
+ "review_type": "individual",
1078
+ "reviewer_id": self.test_user_3_multi_company.id,
1079
+ "sequence": 10,
1080
+ "approve_sequence": True,
1081
+ "notify_on_create": False,
1082
+ "notify_on_accepted": True,
1083
+ }
1084
+ )
1085
+ mt_tier_validation_requested = self.env.ref(
1086
+ "base_tier_validation.mt_tier_validation_requested"
1087
+ )
1088
+ mt_tier_validation_accepted = self.env.ref(
1089
+ "base_tier_validation.mt_tier_validation_accepted"
1090
+ )
1091
+ test_record.request_validation()
1092
+ review_1 = test_record.review_ids.filtered(
1093
+ lambda x: x.definition_id == self.tier_definition
1094
+ )
1095
+ self.assertEqual(review_1.status, "pending")
1096
+ review_2 = test_record.review_ids.filtered(lambda x: x.definition_id == def_2)
1097
+ self.assertEqual(review_2.status, "pending")
1098
+ review_3 = test_record.review_ids.filtered(lambda x: x.definition_id == def_3)
1099
+ self.assertEqual(review_3.status, "pending")
1100
+ followers = test_record.message_follower_ids
1101
+ self.assertIn(self.test_user_1.partner_id, followers.mapped("partner_id"))
1102
+ follower_1 = followers.filtered(
1103
+ lambda x: x.partner_id == self.test_user_1.partner_id
1104
+ )
1105
+ self.assertIn(mt_tier_validation_requested, follower_1.subtype_ids)
1106
+ self.assertNotIn(mt_tier_validation_accepted, follower_1.subtype_ids)
1107
+ self.assertNotIn(self.test_user_2.partner_id, followers.mapped("partner_id"))
1108
+ self.assertNotIn(
1109
+ self.test_user_3_multi_company.partner_id, followers.mapped("partner_id")
1110
+ )
1111
+ old_messages = test_record.message_ids
1112
+ test_record.with_user(self.test_user_1).validate_tier()
1113
+ new_messages = test_record.message_ids - old_messages
1114
+ self.assertEqual(len(new_messages), 1)
1115
+ self.assertEqual(new_messages.subtype_id, mt_tier_validation_accepted)
1116
+ self.assertEqual(self.test_user_2.partner_id, new_messages.notified_partner_ids)
1117
+ self.assertEqual(review_1.status, "approved")
1118
+ self.assertEqual(review_2.status, "pending")
1119
+ self.assertEqual(review_3.status, "pending")
1120
+ followers = test_record.message_follower_ids
1121
+ self.assertIn(self.test_user_1.partner_id, followers.mapped("partner_id"))
1122
+ self.assertIn(self.test_user_2.partner_id, followers.mapped("partner_id"))
1123
+ follower_2 = followers.filtered(
1124
+ lambda x: x.partner_id == self.test_user_2.partner_id
1125
+ )
1126
+ self.assertNotIn(mt_tier_validation_requested, follower_2.subtype_ids)
1127
+ self.assertIn(mt_tier_validation_accepted, follower_2.subtype_ids)
1128
+ self.assertNotIn(
1129
+ self.test_user_3_multi_company.partner_id, followers.mapped("partner_id")
1130
+ )
1131
+ old_messages = test_record.message_ids
1132
+ test_record.with_user(self.test_user_2).validate_tier()
1133
+ new_messages = test_record.message_ids - old_messages
1134
+ self.assertEqual(len(new_messages), 1)
1135
+ self.assertEqual(new_messages.subtype_id, mt_tier_validation_accepted)
1136
+ self.assertEqual(
1137
+ self.test_user_3_multi_company.partner_id, new_messages.notified_partner_ids
1138
+ )
1139
+ self.assertEqual(review_1.status, "approved")
1140
+ self.assertEqual(review_2.status, "approved")
1141
+ self.assertEqual(review_3.status, "pending")
1142
+ followers = test_record.message_follower_ids
1143
+ self.assertIn(self.test_user_1.partner_id, followers.mapped("partner_id"))
1144
+ self.assertIn(self.test_user_2.partner_id, followers.mapped("partner_id"))
1145
+ self.assertIn(
1146
+ self.test_user_3_multi_company.partner_id, followers.mapped("partner_id")
1147
+ )
1148
+ follower_3 = followers.filtered(
1149
+ lambda x: x.partner_id == self.test_user_3_multi_company.partner_id
1150
+ )
1151
+ self.assertNotIn(mt_tier_validation_requested, follower_3.subtype_ids)
1152
+ self.assertIn(mt_tier_validation_accepted, follower_3.subtype_ids)
1153
+ old_messages = test_record.message_ids
1154
+ test_record.with_user(self.test_user_3_multi_company).validate_tier()
1155
+ new_messages = test_record.message_ids - old_messages
1156
+ self.assertEqual(len(new_messages), 0)
1157
+
1158
+ def test_31_request_validation(self):
1159
+ # Create new test record
1160
+ test_record = self.test_model.create({"test_field": 2.5})
1161
+ # Create tier definitions for both tester models
1162
+ self.tier_definition.write(
1163
+ {
1164
+ "approve_sequence": True,
1165
+ "notify_on_create": True,
1166
+ }
1167
+ )
1168
+ def_2 = self.tier_def_obj.create(
1169
+ {
1170
+ "model_id": self.tester_model.id,
1171
+ "review_type": "individual",
1172
+ "reviewer_id": self.test_user_2.id,
1173
+ "sequence": 20,
1174
+ "approve_sequence": True,
1175
+ "notify_on_create": True,
1176
+ "notify_on_accepted": True,
1177
+ }
1178
+ )
1179
+ def_3 = self.tier_def_obj.create(
1180
+ {
1181
+ "model_id": self.tester_model.id,
1182
+ "review_type": "individual",
1183
+ "reviewer_id": self.test_user_3_multi_company.id,
1184
+ "sequence": 10,
1185
+ "approve_sequence": True,
1186
+ "notify_on_create": True,
1187
+ "notify_on_accepted": True,
1188
+ }
1189
+ )
1190
+ test_record.request_validation()
1191
+ review_1 = test_record.review_ids.filtered(
1192
+ lambda x: x.definition_id == self.tier_definition
1193
+ )
1194
+ self.assertEqual(review_1.status, "pending")
1195
+ review_2 = test_record.review_ids.filtered(lambda x: x.definition_id == def_2)
1196
+ self.assertEqual(review_2.status, "pending")
1197
+ review_3 = test_record.review_ids.filtered(lambda x: x.definition_id == def_3)
1198
+ self.assertEqual(review_3.status, "pending")
1199
+ followers = test_record.message_follower_ids
1200
+ self.assertIn(self.test_user_1.partner_id, followers.mapped("partner_id"))
1201
+ self.assertIn(self.test_user_2.partner_id, followers.mapped("partner_id"))
1202
+ self.assertIn(
1203
+ self.test_user_3_multi_company.partner_id, followers.mapped("partner_id")
1204
+ )
1205
+
1053
1206
 
1054
1207
  @tagged("at_install")
1055
1208
  class TierTierValidationView(CommonTierValidation):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-base_tier_validation
3
- Version: 16.0.2.6.0.1
3
+ Version: 16.0.3.0.0
4
4
  Summary: Implement a validation process based on tiers.
5
5
  Home-page: https://github.com/OCA/server-ux
6
6
  Author: ForgeFlow, Odoo Community Association (OCA)
@@ -14,6 +14,10 @@ Classifier: Development Status :: 6 - Mature
14
14
  Requires-Python: >=3.10
15
15
  Requires-Dist: odoo<16.1dev,>=16.0a
16
16
 
17
+ .. image:: https://odoo-community.org/readme-banner-image
18
+ :target: https://odoo-community.org/get-involved?utm_source=readme
19
+ :alt: Odoo Community Association
20
+
17
21
  ====================
18
22
  Base Tier Validation
19
23
  ====================
@@ -23,13 +27,13 @@ Base Tier Validation
23
27
  !! This file is generated by oca-gen-addon-readme !!
24
28
  !! changes will be overwritten. !!
25
29
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
26
- !! source digest: sha256:8e99bb2b477c5c3a3ce8a49b2f854341131b246b0a7b1ea30c4e04acf1dbeaec
30
+ !! source digest: sha256:f3093af0e62d45b3f67e36b93c79f6b5a0ba627d57ae5c78d3242c7df5f1deac
27
31
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28
32
 
29
33
  .. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
30
34
  :target: https://odoo-community.org/page/development-status
31
35
  :alt: Mature
32
- .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
36
+ .. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
33
37
  :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
34
38
  :alt: License: AGPL-3
35
39
  .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fserver--ux-lightgray.png?logo=github
@@ -1,8 +1,8 @@
1
- odoo/addons/base_tier_validation/README.rst,sha256=Sxxf574eNVV2IkDmBEPnurzl8SGNNml4a8O0tst5Mc8,7996
1
+ odoo/addons/base_tier_validation/README.rst,sha256=ZnV7OY59pa9vwbudnMM9AadgvjYLM3x6tBaRbsM0waQ,8161
2
2
  odoo/addons/base_tier_validation/__init__.py,sha256=rKfzYX9RhkkCxgh2f0PJLYN45Kw8T8-fwxw1pbjLuug,108
3
- odoo/addons/base_tier_validation/__manifest__.py,sha256=79nt4BfpMiUmxKOtt5pvt3ui3L5i_HOiKCu-1ueo5LM,2011
3
+ odoo/addons/base_tier_validation/__manifest__.py,sha256=uPv9NHVqIViJQoCjvGMMxFQL58NEQ_CIvmYER4rvifk,2011
4
4
  odoo/addons/base_tier_validation/data/cron_data.xml,sha256=HMA_SgAk3_vLu_QQLHd0UyzPASuDRj5cvpiK_17esQc,707
5
- odoo/addons/base_tier_validation/data/mail_data.xml,sha256=hXhGTSyG2NAsDfZShmpyBKTXJi46L5PP1mFJAlKmlVE,1984
5
+ odoo/addons/base_tier_validation/data/mail_data.xml,sha256=8laJ1b4wUxh890yxtP8AQis8MHuXc4brCtV-3F-YmhI,1988
6
6
  odoo/addons/base_tier_validation/i18n/base_tier_validation.pot,sha256=Ap_T6TSlEoy4uXvycYBt7EA4SbyymwJWlKWiei7S2KQ,32404
7
7
  odoo/addons/base_tier_validation/i18n/es.po,sha256=wj3-zZ3bLMGYmC7eNpn3iS9EdHB7ffAAPmBwZAz5VXU,38203
8
8
  odoo/addons/base_tier_validation/i18n/es_MX.po,sha256=42TY-Dsn2Msuz38tXURWJZAi9XkAJ7IlHdYx3M-5kJw,35717
@@ -17,7 +17,7 @@ odoo/addons/base_tier_validation/models/res_config_settings.py,sha256=n-i1InkXDc
17
17
  odoo/addons/base_tier_validation/models/res_users.py,sha256=JhUZ0NxJ9EPwpkJ-mvsNTrE1avQncGNKqAF-xFxokEo,2638
18
18
  odoo/addons/base_tier_validation/models/tier_definition.py,sha256=rcDv7ySDKqBD1ksJ09um_4Reec_Im1MrdotivQ7Q_44,5173
19
19
  odoo/addons/base_tier_validation/models/tier_review.py,sha256=a7vMoaN4uWZqN48CmlK9x4ou9Ao0r4i6FuSSqPah6Qw,7329
20
- odoo/addons/base_tier_validation/models/tier_validation.py,sha256=IfVARiZPcmw7y9LauVLFMwc96b_1BNRfZNzK79GQ74A,33179
20
+ odoo/addons/base_tier_validation/models/tier_validation.py,sha256=jdy795ScUe92S3oNA4bkNMu2UgdUtxeOU-RUvwJnIoo,35193
21
21
  odoo/addons/base_tier_validation/models/tier_validation_exception.py,sha256=9H_FbTF04IyB2u6a82UAdIPmv_MUcFKmLNVl7UOM1lg,2882
22
22
  odoo/addons/base_tier_validation/readme/CONFIGURE.rst,sha256=ABgtWmfnm0QieIj7_ZsvoTHwjaKiZkBLCAjUXJeOnm4,1466
23
23
  odoo/addons/base_tier_validation/readme/CONTRIBUTORS.rst,sha256=hyMj4T9es9vnGNmdg-uPF9wc1xGRxC5DU39McI03xjA,479
@@ -27,7 +27,7 @@ odoo/addons/base_tier_validation/readme/ROADMAP.rst,sha256=UWhIpMUTM_ido6s3jZiF8
27
27
  odoo/addons/base_tier_validation/security/ir.model.access.csv,sha256=vsKy73mk8r45jzU0fAt_vfM7-JSH7lIAA7JBr1P6FAY,633
28
28
  odoo/addons/base_tier_validation/security/tier_validation_security.xml,sha256=eWFwz-osHgYFmVoEVzOSboO9oqUMtQ8oygyaz0os50Y,806
29
29
  odoo/addons/base_tier_validation/static/description/icon.png,sha256=6xBPJauaFOF0KDHfHgQopSc28kKvxMaeoQFQWZtfZDo,9455
30
- odoo/addons/base_tier_validation/static/description/index.html,sha256=ZNC0M7ADQZ-OVswN0jXecbZWAFxuOuGj1dObLtuY2yw,22306
30
+ odoo/addons/base_tier_validation/static/description/index.html,sha256=2Sk6iLgF5LmkeTyp1ujGZOjK2RMfFbpPNncMfK3Iuc8,22523
31
31
  odoo/addons/base_tier_validation/static/src/js/ir_model.esm.js,sha256=kHSA7CeIt02IZmsKJdn2yZVqKqSyQ6_g6QVmtq5Qo2A,706
32
32
  odoo/addons/base_tier_validation/static/src/js/main.esm.js,sha256=ZSHScoLlMQcO6jW9mLVusJOfyH5kJIw4szPK3xU-KHA,263
33
33
  odoo/addons/base_tier_validation/static/src/js/review_group_view.esm.js,sha256=G110cBwOwENHBUkuScOB8Xg05D0FzOqlsSl_US0PngA,1677
@@ -43,10 +43,10 @@ odoo/addons/base_tier_validation/static/src/scss/systray.scss,sha256=vco1l3nsJfX
43
43
  odoo/addons/base_tier_validation/static/src/xml/reviewer_menu_container.xml,sha256=pMgADQ7SgdHrE_FTo2hnpDJqPbuc9jOHXHSAaa0Gjbk,271
44
44
  odoo/addons/base_tier_validation/static/src/xml/systray.xml,sha256=8W04E80UhUPQp6U9zvmDu1qqOXsDaDP8Q5YFw6Dgg7s,4987
45
45
  odoo/addons/base_tier_validation/static/src/xml/tier_review_template.xml,sha256=o72pPVkPiPmr2KWucaTJahR945MbD4gaYyi3KQn6AyI,6217
46
- odoo/addons/base_tier_validation/templates/tier_validation_templates.xml,sha256=_LylRMVAyooIRsK8Y-Lanpi_S3ch1Ts9bJkxewKbr3k,4619
47
- odoo/addons/base_tier_validation/tests/__init__.py,sha256=7tj1DSbPnyA__lAKxvjX53Ll_ZTE8y8Z1bewtZJoURI,166
46
+ odoo/addons/base_tier_validation/templates/tier_validation_templates.xml,sha256=oEgy1wbHdYua7i5arXeli1WzZt9iwEgSZUMC_pDmnGU,4680
47
+ odoo/addons/base_tier_validation/tests/__init__.py,sha256=GPQ_IJXExtr8NbvHAjPwyfJdu5kBS_ZjfTX2X_GyM9M,145
48
48
  odoo/addons/base_tier_validation/tests/common.py,sha256=kCSmRUWy9qcmXfVpJ-ixTOyj7eL4G75x0p25uWEs7to,5918
49
- odoo/addons/base_tier_validation/tests/test_tier_validation.py,sha256=jOq6eYzzChn6Pwrv2C32mK17S0Ye3Z_cuJEDuvHWGsQ,43356
49
+ odoo/addons/base_tier_validation/tests/test_tier_validation.py,sha256=65bJs_aejEAZ8dNKjLgiJA77kd729_rVg96wy4tsenM,50451
50
50
  odoo/addons/base_tier_validation/tests/test_tier_validation_reminder.py,sha256=jsLU-7pJtbUvKPi7ddXU4jAwiJp32pKTrluarrtLKvU,1963
51
51
  odoo/addons/base_tier_validation/tests/tier_validation_tester.py,sha256=zlpJLmxpgnZhpUJ_kFqRVInQftOkgjT3lQ-uzcjn_F0,1818
52
52
  odoo/addons/base_tier_validation/views/res_config_settings_views.xml,sha256=Al6XKCN1QGLPcgAaXTvEnSTYkwBrzDGfSRh3CQD4g5Q,4234
@@ -56,7 +56,7 @@ odoo/addons/base_tier_validation/views/tier_validation_exception_view.xml,sha256
56
56
  odoo/addons/base_tier_validation/wizard/__init__.py,sha256=52q6-LAjYeJ1Vu5ahon_jnhds9VsoJvYaQCiZc82WKw,95
57
57
  odoo/addons/base_tier_validation/wizard/comment_wizard.py,sha256=gj7zCcpe47-2ifxSRlE6okQ1wtq5Ok3JBVg2CtN0ZIU,879
58
58
  odoo/addons/base_tier_validation/wizard/comment_wizard_view.xml,sha256=9XFTqrNwDCZH2IEX3HutaznSkBYk-6RERXzUDwObz4I,979
59
- odoo_addon_base_tier_validation-16.0.2.6.0.1.dist-info/METADATA,sha256=tGMhZXsEcLxcDHutLQXO86S60LhEdi-zyptwpygaL9A,8580
60
- odoo_addon_base_tier_validation-16.0.2.6.0.1.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
61
- odoo_addon_base_tier_validation-16.0.2.6.0.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
62
- odoo_addon_base_tier_validation-16.0.2.6.0.1.dist-info/RECORD,,
59
+ odoo_addon_base_tier_validation-16.0.3.0.0.dist-info/METADATA,sha256=XadeFVZTkk6BXjXy7JIX0NeMwNpdNdwWVjEjcWWDDs0,8743
60
+ odoo_addon_base_tier_validation-16.0.3.0.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
61
+ odoo_addon_base_tier_validation-16.0.3.0.0.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
62
+ odoo_addon_base_tier_validation-16.0.3.0.0.dist-info/RECORD,,