Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
52f060a
[ADD] portal_sale_personal_data_only: New module
chienandalu Sep 27, 2018
2e84e38
[MIG] portal_sale_personal_data_only: Migration to 12.0
chienandalu Jun 20, 2019
7131767
Added translation using Weblate (German)
marylla Jul 15, 2019
39755a1
Added translation using Weblate (Chinese (Simplified))
liweijie0812 Sep 1, 2019
a6b5b6d
[IMP] portal_sale_personal_data_only: black, isort, prettier
HaraldPanten May 7, 2020
f684dd5
[MIG]portal_sale_personal_data_only: Migration to 13.0
HaraldPanten May 7, 2020
f164b4d
Added translation using Weblate (Spanish)
danimv5 Jul 27, 2020
ed28db9
[13.0][FIX] portal_sale_personal_data_only: invalid domain in ir.rule
kirca Mar 9, 2021
2574807
[IMP] portal_sale_personal_data_only: black, isort, prettier
victoralmau Sep 24, 2021
b21918a
[MIG] portal_sale_personal_data_only: Migration to 14.0
victoralmau Sep 24, 2021
1375b9a
[IMP] portal_sale_personal_data_only: black, isort, prettier
moaadbourhim Feb 12, 2022
c48d037
[MIG] portal_sale_personal_data_only: Migration to 15.0
moaadbourhim Feb 12, 2022
f22b664
[REF] portal_sale_personal_data_only: outsource invoice features
yajo Oct 26, 2022
d35ebe8
[MIG] portal_sale_personal_data_only: Migration to 16.0
stefan-tecnativa Oct 26, 2023
7b0ec3e
Added translation using Weblate (Italian)
mymage Dec 1, 2023
59db04c
[IMP] portal_sale_personal_data_only: pre-commit auto fixes
Aug 30, 2024
7d23354
[MIG] portal_sale_personal_data_only: Migration to 17.0
Sep 3, 2024
8dcc921
[UPD] Update portal_sale_personal_data_only.pot
Nov 29, 2024
3050c9a
[BOT] post-merge updates
OCA-git-bot Nov 29, 2024
c1e61d9
Update translation files
weblate Nov 29, 2024
35a049a
[MIG] portal_sale_personal_data_only: Migration to 18.0
bizzappdev May 2, 2025
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:e61f135c57f854a198e8c1d4c6a0329d256a7e6582b0251e88886f04bbd509cf
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/18.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-18-0/sale-workflow-18-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=18.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:%2018.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 <harald.panten@sygel.es>
- `Tecnativa <https://www.tecnativa.com>`__:

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

- Moaad Bourhim <moaad.bourhim@gmail.com>
- Jairo Llopis (`Moduon <https://www.moduon.team/>`__)
- SodexisTeam <dev@sodexis.com>

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/18.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": "18.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.
Empty file.
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 17.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 \<<harald.panten@sygel.es>\>
- [Tecnativa](https://www.tecnativa.com):
- David Vidal
- Víctor Martínez
- Stefan Ungureanu
- Moaad Bourhim \<<moaad.bourhim@gmail.com>\>
- Jairo Llopis ([Moduon](https://www.moduon.team/))
- SodexisTeam \<<dev@sodexis.com>\>
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