Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[17.0][MIG] portal_sale_personal_data_only: Migration to 17.0 #3299

Open
wants to merge 19 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
ed790e3
[ADD] portal_sale_personal_data_only: New module
chienandalu Sep 27, 2018
f1a98ce
[MIG] portal_sale_personal_data_only: Migration to 12.0
chienandalu Jun 20, 2019
5b41039
Added translation using Weblate (German)
marylla Jul 15, 2019
3f119b8
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
46393fa
[IMP] portal_sale_personal_data_only: black, isort, prettier
HaraldPanten May 7, 2020
47242ab
[MIG]portal_sale_personal_data_only: Migration to 13.0
HaraldPanten May 7, 2020
23b4592
Added translation using Weblate (Spanish)
danimv5 Jul 27, 2020
f1f917e
[13.0][FIX] portal_sale_personal_data_only: invalid domain in ir.rule
kirca Mar 9, 2021
be08d1e
[IMP] portal_sale_personal_data_only: black, isort, prettier
victoralmau Sep 24, 2021
980ea2d
[MIG] portal_sale_personal_data_only: Migration to 14.0
victoralmau Sep 24, 2021
33fe12a
[IMP] portal_sale_personal_data_only: black, isort, prettier
moaadbourhim Feb 12, 2022
a17cd29
[MIG] portal_sale_personal_data_only: Migration to 15.0
moaadbourhim Feb 12, 2022
2f147e7
[REF] portal_sale_personal_data_only: outsource invoice features
yajo Oct 26, 2022
2af94f0
[MIG] portal_sale_personal_data_only: Migration to 16.0
stefan-tecnativa Oct 26, 2023
422b261
[UPD] Update portal_sale_personal_data_only.pot
Oct 28, 2023
7f59a89
Added translation using Weblate (Italian)
mymage Dec 1, 2023
8008dba
[IMP] portal_sale_personal_data_only: pre-commit auto fixes
Aug 30, 2024
a8766fc
[MIG] portal_sale_personal_data_only: Migration to 17.0
Sep 3, 2024
2d7a549
[DON'T MERGE] test-requirements.txt
Sep 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions portal_sale_personal_data_only/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
==============================
Portal Sale Personal Data Only
==============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:888fb88e882fa46346be67a510a81979302b15950028833cafd0d6659615746b
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
: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/17.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-17-0/sale-workflow-17-0-portal_sale_personal_data_only
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/sale-workflow&target_branch=17.0
:alt: Try me on Runboat

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

By default, portal users are allowed to see all the sale orders 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**

.. contents::
:local:

Usage
=====

1. Create some portal users belonging to the same company.
2. Place some orders for several of these users.
3. Log in with each portal user credential.
4. Only the sale orders belonging to the logged in user's partner or his
descendants should be accessible.
5. 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 to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/sale-workflow/issues/new?body=module:%20portal_sale_personal_data_only%0Aversion:%2017.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.

Credits
=======

Authors
-------

* Tecnativa

Contributors
------------

- Harald Panten <[email protected]>
- `Tecnativa <https://www.tecnativa.com>`__:

- David Vidal
- Víctor Martínez
- Stefan Ungureanu

- Moaad Bourhim <[email protected]>
- Jairo Llopis (`Moduon <https://www.moduon.team/>`__)
- SodexisTeam <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

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/17.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.
1 change: 1 addition & 0 deletions portal_sale_personal_data_only/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .hooks import post_init_hook, uninstall_hook
16 changes: 16 additions & 0 deletions portal_sale_personal_data_only/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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",
"version": "17.0.1.0.0",
"category": "Sale",
"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/sale-workflow",
"license": "AGPL-3",
"depends": ["sale", "portal_account_personal_data_only"],
"auto_install": True,
"data": ["security/security.xml"],
"installable": True,
"post_init_hook": "post_init_hook",
"uninstall_hook": "uninstall_hook",
}
14 changes: 14 additions & 0 deletions portal_sale_personal_data_only/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2019 Tecnativa - David Vidal
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


def post_init_hook(env):
"""Archive the ir.rules we want to override"""
env.ref("sale.sale_order_rule_portal").active = False
env.ref("sale.sale_order_line_rule_portal").active = False

Check warning on line 8 in portal_sale_personal_data_only/hooks.py

View check run for this annotation

Codecov / codecov/patch

portal_sale_personal_data_only/hooks.py#L7-L8

Added lines #L7 - L8 were not covered by tests


def uninstall_hook(env):
"""Unarchive the overriden ir.rules"""
env.ref("sale.sale_order_rule_portal").active = True
env.ref("sale.sale_order_line_rule_portal").active = True

Check warning on line 14 in portal_sale_personal_data_only/hooks.py

View check run for this annotation

Codecov / codecov/patch

portal_sale_personal_data_only/hooks.py#L13-L14

Added lines #L13 - L14 were not covered by tests
Empty file.
Empty file.
14 changes: 14 additions & 0 deletions portal_sale_personal_data_only/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: it\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=2; plural=n != 1;\n"
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"
Empty file.
3 changes: 3 additions & 0 deletions portal_sale_personal_data_only/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
8 changes: 8 additions & 0 deletions portal_sale_personal_data_only/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- Harald Panten \<<[email protected]>\>
- [Tecnativa](https://www.tecnativa.com):
- David Vidal
- Víctor Martínez
- Stefan Ungureanu
- Moaad Bourhim \<<[email protected]>\>
- Jairo Llopis ([Moduon](https://www.moduon.team/))
- SodexisTeam \<<[email protected]>\>
7 changes: 7 additions & 0 deletions portal_sale_personal_data_only/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
By default, portal users are allowed to see all the sale orders 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.
7 changes: 7 additions & 0 deletions portal_sale_personal_data_only/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
1. Create some portal users belonging to the same company.
2. Place some orders for several of these users.
3. Log in with each portal user credential.
4. Only the sale orders belonging to the logged in user's partner or
his descendants should be accessible.
5. Invoices associated to a partner's sale order will be visible as
well.
39 changes: 39 additions & 0 deletions portal_sale_personal_data_only/security/security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo noupdate="1">
<record id="portal_sale_order_user_rule" model="ir.rule">
<field name="name">Portal Only Personal Quotations/Sales</field>
<field name="model_id" ref="sale.model_sale_order" />
<field
name="domain_force"
>[('message_partner_ids','child_of', [user.partner_id.id])]</field>
<field name="groups" eval="[(4, ref('base.group_portal'))]" />
</record>
<record id="portal_sale_order_line_rule" model="ir.rule">
<field name="name">Portal Only Personal Sales Orders Line</field>
<field name="model_id" ref="sale.model_sale_order_line" />
<field
name="domain_force"
>[('order_id.message_partner_ids','child_of', [user.partner_id.id])]</field>
<field name="groups" eval="[(4, ref('base.group_portal'))]" />
</record>
<record id="portal_account_invoice_user_rule" model="ir.rule">
<field
name="name"
>Portal display personal invoices linked to personal sale orders</field>
<field name="model_id" ref="account.model_account_move" />
<field name="domain_force">
[('invoice_line_ids.sale_line_ids.order_id.message_partner_ids', 'child_of', [user.partner_id.id])]
</field>
<field name="groups" eval="[(4, ref('base.group_portal'))]" />
</record>
<record id="portal_account_invoice_line_rule" model="ir.rule">
<field
name="name"
>Portal display personal invoice lines linked to personal sale orders</field>
<field name="model_id" ref="account.model_account_move_line" />
<field name="domain_force">
[('sale_line_ids.order_id.message_partner_ids', 'child_of', [user.partner_id.id])]
</field>
<field name="groups" eval="[(4, ref('base.group_portal'))]" />
</record>
</odoo>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading