diff --git a/portal_sale_personal_data_only/README.rst b/portal_sale_personal_data_only/README.rst index b21cb0caeb9..c71b2c64fc2 100644 --- a/portal_sale_personal_data_only/README.rst +++ b/portal_sale_personal_data_only/README.rst @@ -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. @@ -44,8 +44,9 @@ 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 =========== @@ -53,7 +54,7 @@ Bug Tracker Bugs are tracked on `GitHub 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -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 `_ project on GitHub. +This module is part of the `OCA/sale-workflow `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/portal_sale_personal_data_only/__manifest__.py b/portal_sale_personal_data_only/__manifest__.py index ec2fa18186f..5028f355019 100644 --- a/portal_sale_personal_data_only/__manifest__.py +++ b/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', diff --git a/portal_sale_personal_data_only/hooks.py b/portal_sale_personal_data_only/hooks.py index 7285bb393d0..4bb8f68207e 100644 --- a/portal_sale_personal_data_only/hooks.py +++ b/portal_sale_personal_data_only/hooks.py @@ -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 diff --git a/portal_sale_personal_data_only/static/description/index.html b/portal_sale_personal_data_only/static/description/index.html index 4ca987eea8e..5fd6c939fb8 100644 --- a/portal_sale_personal_data_only/static/description/index.html +++ b/portal_sale_personal_data_only/static/description/index.html @@ -367,11 +367,11 @@

Portal Sale Personal Data Only

!! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runbot

-

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.

+

Beta License: AGPL-3 OCA/sale-workflow Translate me on Weblate Try me on Runbot

+

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.

Table of contents

@@ -393,8 +393,9 @@

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.
  • @@ -402,7 +403,7 @@

    Bug Tracker

    Bugs are tracked on GitHub 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.

    +feedback.

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

    @@ -426,7 +427,7 @@

    Maintainers

    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 project on GitHub.

    +

    This module is part of the OCA/sale-workflow project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.