-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] temp model test name & fix OCA remarks
- Loading branch information
1 parent
1906fc8
commit b0f591f
Showing
4 changed files
with
20 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,8 @@ | |
# Mourad EL HADJ MIMOUNE <[email protected]> | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
||
from odoo import api, fields, models | ||
from odoo import api, fields, models, _ | ||
from odoo.exceptions import ValidationError | ||
|
||
|
||
class ExceptionRuleConfirm(models.AbstractModel): | ||
|
@@ -22,7 +23,9 @@ def default_get(self, field_list): | |
current_model = self._context.get('active_model') | ||
model_except_obj = self.env[current_model] | ||
active_ids = self._context.get('active_ids') | ||
assert len(active_ids) == 1, "Only 1 ID accepted, got %r" % active_ids | ||
if len(active_ids) > 1: | ||
raise ValidationError( | ||
_('Only 1 ID accepted, got %r.') % active_ids) | ||
active_id = active_ids[0] | ||
related_model_except = model_except_obj.browse(active_id) | ||
exception_ids = [e.id for e in related_model_except.exception_ids] | ||
|