Skip to content

Commit

Permalink
[MIG] portal_sale_personal_data_only: Migration to 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
chienandalu authored and OCA-git-bot committed Jun 24, 2019
1 parent 9a3d05e commit 1082827
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 32 deletions.
23 changes: 12 additions & 11 deletions portal_sale_personal_data_only/README.rst
Expand Up @@ -14,21 +14,21 @@ Portal Sale Personal Data Only
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github
:target: https://github.com/OCA/sale-workflow/tree/10.0/portal_sale_personal_data_only
:target: https://github.com/OCA/sale-workflow/tree/12.0/portal_sale_personal_data_only
:alt: OCA/sale-workflow
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/sale-workflow-10-0/sale-workflow-10-0-portal_sale_personal_data_only
:target: https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-portal_sale_personal_data_only
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/167/10.0
:target: https://runbot.odoo-community.org/runbot/167/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

By default, portal users are allowed to see al the orders and invoices in wich
a member of their organization are followers. That could cause a leaking of
documents between members and departments and of the organization that should
stay private.
By default, portal users are allowed to see all the orders and invoices in
which a member of their organization are followers. That could cause a leaking
of documents between members and departments and of the organization that
should stay private.

This module restricts that behaviour so the portal users only see their own
documents.
Expand All @@ -44,16 +44,17 @@ Usage
#. Create some portal users belonging to the same company.
#. Place some orders for several of these users.
#. Log in with each portal user credential.
#. Only the orders and invoices belonging to the logged in user should be
accessible.
#. Only the orders and invoices belonging to the logged in user's partner or
his descendants should be accessible.
#. Invoices associated to a partner's sale order will be visible as well.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/sale-workflow/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20portal_sale_personal_data_only%0Aversion:%2010.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20portal_sale_personal_data_only%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Expand Down Expand Up @@ -83,6 +84,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/10.0/portal_sale_personal_data_only>`_ project on GitHub.
This module is part of the `OCA/sale-workflow <https://github.com/OCA/sale-workflow/tree/12.0/portal_sale_personal_data_only>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
7 changes: 3 additions & 4 deletions portal_sale_personal_data_only/__manifest__.py
@@ -1,17 +1,16 @@
# -*- coding: utf-8 -*-
# Copyright 2018 Tecnativa S.L. - David Vidal
# Copyright 2018-19 Tecnativa S.L. - David Vidal
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
'name': 'Portal Sale Personal Data Only',
'description': 'Allow portal users to see their own documents',
'version': '10.0.1.0.0',
'version': '12.0.1.0.0',
'category': 'Sale',
'author': 'Tecnativa,'
'Odoo Community Association (OCA)',
'website': 'https://www.github.com/OCA/sale-workflow',
"license": "AGPL-3",
'depends': [
'portal_sale',
'sale',
],
'data': [
'data/portal_sale_security.xml',
Expand Down
16 changes: 8 additions & 8 deletions portal_sale_personal_data_only/hooks.py
Expand Up @@ -6,16 +6,16 @@
def post_init_hook(cr, registry, vals=None):
"""Archive the ir.rules we want to override"""
env = api.Environment(cr, SUPERUSER_ID, {})
env.ref('portal_sale.portal_sale_order_user_rule').active = False
env.ref('portal_sale.portal_sale_order_line_rule').active = False
env.ref('portal_sale.portal_account_invoice_user_rule').active = False
env.ref('portal_sale.portal_account_invoice_line_rule').active = False
env.ref('sale.sale_order_rule_portal').active = False
env.ref('sale.sale_order_line_rule_portal').active = False
env.ref('account.account_invoice_rule_portal').active = False
env.ref('account.account_invoice_line_rule_portal').active = False


def uninstall_hook(cr, registry, vals=None):
"""Unarchive the overriden ir.rules"""
env = api.Environment(cr, SUPERUSER_ID, {})
env.ref('portal_sale.portal_sale_order_user_rule').active = True
env.ref('portal_sale.portal_sale_order_line_rule').active = True
env.ref('portal_sale.portal_account_invoice_user_rule').active = True
env.ref('portal_sale.portal_account_invoice_line_rule').active = True
env.ref('sale.sale_order_rule_portal').active = True
env.ref('sale.sale_order_line_rule_portal').active = True
env.ref('account.account_invoice_rule_portal').active = True
env.ref('account.account_invoice_line_rule_portal').active = True
19 changes: 10 additions & 9 deletions portal_sale_personal_data_only/static/description/index.html
Expand Up @@ -367,11 +367,11 @@ <h1 class="title">Portal Sale Personal Data Only</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" 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" href="https://github.com/OCA/sale-workflow/tree/10.0/portal_sale_personal_data_only"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/sale-workflow-10-0/sale-workflow-10-0-portal_sale_personal_data_only"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/167/10.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>By default, portal users are allowed to see al the orders and invoices in wich
a member of their organization are followers. That could cause a leaking of
documents between members and departments and of the organization that should
stay private.</p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" 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" href="https://github.com/OCA/sale-workflow/tree/12.0/portal_sale_personal_data_only"><img alt="OCA/sale-workflow" src="https://img.shields.io/badge/github-OCA%2Fsale--workflow-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/sale-workflow-12-0/sale-workflow-12-0-portal_sale_personal_data_only"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/167/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>By default, portal users are allowed to see all the orders and invoices in
which a member of their organization are followers. That could cause a leaking
of documents between members and departments and of the organization that
should stay private.</p>
<p>This module restricts that behaviour so the portal users only see their own
documents.</p>
<p><strong>Table of contents</strong></p>
Expand All @@ -393,16 +393,17 @@ <h1><a class="toc-backref" href="#id1">Usage</a></h1>
<li>Create some portal users belonging to the same company.</li>
<li>Place some orders for several of these users.</li>
<li>Log in with each portal user credential.</li>
<li>Only the orders and invoices belonging to the logged in user should be
accessible.</li>
<li>Only the orders and invoices belonging to the logged in user’s partner or
his descendants should be accessible.</li>
<li>Invoices associated to a partner’s sale order will be visible as well.</li>
</ol>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/sale-workflow/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20portal_sale_personal_data_only%0Aversion:%2010.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/sale-workflow/issues/new?body=module:%20portal_sale_personal_data_only%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
Expand All @@ -426,7 +427,7 @@ <h2><a class="toc-backref" href="#id6">Maintainers</a></h2>
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/10.0/portal_sale_personal_data_only">OCA/sale-workflow</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/sale-workflow/tree/12.0/portal_sale_personal_data_only">OCA/sale-workflow</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
Expand Down

0 comments on commit 1082827

Please sign in to comment.