Browse Source
Merge pull request #1299 from Eficent/9.0-fix-base_tier_validation-need_validation
[FIX] base_tier_validation: _compute_need_validation (rec vs self)
pull/1301/head
Jordi Ballester Alomar
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
3 additions and
3 deletions
-
base_tier_validation/__openerp__.py
-
base_tier_validation/models/tier_validation.py
|
@ -4,7 +4,7 @@ |
|
|
{ |
|
|
{ |
|
|
"name": "Base Tier Validation", |
|
|
"name": "Base Tier Validation", |
|
|
"summary": "Implement a validation process based on tiers.", |
|
|
"summary": "Implement a validation process based on tiers.", |
|
|
"version": "9.0.1.0.1", |
|
|
|
|
|
|
|
|
"version": "9.0.1.0.2", |
|
|
"category": "Tools", |
|
|
"category": "Tools", |
|
|
"website": "https://github.com/OCA/server-tools", |
|
|
"website": "https://github.com/OCA/server-tools", |
|
|
"author": "Eficent, Odoo Community Association (OCA)", |
|
|
"author": "Eficent, Odoo Community Association (OCA)", |
|
|
|
@ -82,8 +82,8 @@ class TierValidation(models.AbstractModel): |
|
|
for rec in self: |
|
|
for rec in self: |
|
|
tiers = self.env[ |
|
|
tiers = self.env[ |
|
|
'tier.definition'].search([('model', '=', self._name)]) |
|
|
'tier.definition'].search([('model', '=', self._name)]) |
|
|
valid_tiers = any([self.evaluate_tier(tier) for tier in tiers]) |
|
|
|
|
|
rec.need_validation = not self.review_ids and valid_tiers and \ |
|
|
|
|
|
|
|
|
valid_tiers = any([rec.evaluate_tier(tier) for tier in tiers]) |
|
|
|
|
|
rec.need_validation = not rec.review_ids and valid_tiers and \ |
|
|
getattr(rec, self._state_field) in self._state_from |
|
|
getattr(rec, self._state_field) in self._state_from |
|
|
|
|
|
|
|
|
@api.multi |
|
|
@api.multi |
|
|