diff --git a/base_tier_validation/__manifest__.py b/base_tier_validation/__manifest__.py index 3d4b40a..ff67920 100644 --- a/base_tier_validation/__manifest__.py +++ b/base_tier_validation/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Base Tier Validation", "summary": "Implement a validation process based on tiers.", - "version": "11.0.2.0.0", + "version": "11.0.2.0.1", "development_status": "Mature", "maintainers": ['lreficent'], "category": "Tools", diff --git a/base_tier_validation/models/tier_validation.py b/base_tier_validation/models/tier_validation.py index 3b474b9..cbb6ade 100644 --- a/base_tier_validation/models/tier_validation.py +++ b/base_tier_validation/models/tier_validation.py @@ -154,7 +154,14 @@ class TierValidation(models.AbstractModel): 'done_by': self.env.user.id, 'reviewed_date': fields.Datetime.now(), }) - # TODO: add message_post + for review in user_reviews: + rec = self.env[review.model].browse(review.res_id) + if hasattr(rec, 'message_post'): + # Notify state change + getattr(rec, 'message_post')( + subtype='mt_comment', + body=_('A review was accepted') + ) @api.multi def validate_tier(self): @@ -173,7 +180,14 @@ class TierValidation(models.AbstractModel): 'done_by': self.env.user.id, 'reviewed_date': fields.Datetime.now(), }) - # TODO: Add Message_post + if hasattr(rec, 'message_post'): + # Notify state change + getattr(rec, 'message_post')( + subtype='mt_comment', + body=_( + 'A review was rejected by %s.' + ) % (self.env.user.name) + ) @api.multi def request_validation(self):