-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by pedrobaeza
- Loading branch information
Showing
14 changed files
with
376 additions
and
217 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
from . import models | ||
from .hooks import restore_access_rules |
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 |
---|---|---|
@@ -1,17 +1,22 @@ | ||
{ | ||
"name": "Sales Commissions Agent Restrict", | ||
"version": "14.0.1.1.1", | ||
"version": "14.0.2.0.0", | ||
"author": "Ooops404, Ilyas, Odoo Community Association (OCA)", | ||
"maintainers": ["aleuffre"], | ||
"category": "Sales", | ||
"website": "https://github.com/OCA/commission", | ||
"license": "AGPL-3", | ||
"depends": ["sale_commission", "web_domain_field"], | ||
"depends": [ | ||
"base_rule_visibility_restriction", | ||
"sale_commission", | ||
"sales_team", | ||
"web_domain_field", | ||
], | ||
"data": [ | ||
"security/security.xml", | ||
"security/ir.model.access.csv", | ||
"views/res_partner_views.xml", | ||
"views/sale_order_view.xml", | ||
], | ||
"uninstall_hook": "restore_access_rules", | ||
"installable": True, | ||
} |
This file was deleted.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
sale_commission_agent_restrict/migrations/14.0.2.0.0/pre-migrate.py
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
from openupgradelib import openupgrade | ||
|
||
PREDEFINED_RULES = [ | ||
"base.res_partner_rule_private_employee", | ||
"base.res_partner_rule_private_group", | ||
] | ||
|
||
|
||
def reset_predefined_rules_to_active(env): | ||
""" | ||
Set rules that were deactivated by the previous version | ||
of the module back to active | ||
""" | ||
for rule_xml_id in PREDEFINED_RULES: | ||
env.ref(rule_xml_id).active = True | ||
|
||
|
||
def remove_view_with_removed_field(env): | ||
""" | ||
This view had nothing else in it but the removed field | ||
so it should be safe to remove | ||
""" | ||
view = env.ref( | ||
"sale_commission_agent_restrict.view_order_form_partner_domain_inherit", | ||
raise_if_not_found=False, | ||
) | ||
if view: | ||
view.unlink() | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
reset_predefined_rules_to_active(env) | ||
remove_view_with_removed_field(env) |
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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
from . import res_users | ||
from . import res_partner | ||
from . import res_users | ||
from . import sale | ||
from . import mail_thread |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
* `Ooops404 <https://www.ooops404.com>`__: | ||
|
||
* Ilyas <[email protected]> | ||
|
||
* `PyTech SRL <https://www.pytech.it>`__: | ||
|
||
* Alessandro Uffreduzzi <[email protected]> |
Oops, something went wrong.