Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
9 changes: 6 additions & 3 deletions portal_partner_state/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,17 @@ Portal with Partner State

This module integrate partner state using portal.

#. Add a model access rule in order to able portal users to see the portal.
#. Add a model access rule in order to able portal users to see the portal:
portal users can read the Partner State Fields configuration and the
fields it points to, but can not modify it.

Installation
============

To install this module, you need to:

#. Just install this module.
#. Just install this module. It is installed automatically when both
"Partner State" and "Portal" are installed.

Configuration
=============
Expand All @@ -48,7 +51,7 @@ Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/ingadhoc/sale/issues>`_. In case of trouble, please
<https://github.com/ingadhoc/partner/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.

Expand Down
6 changes: 3 additions & 3 deletions portal_partner_state/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
"name": "Portal Partner State",
"version": "19.0.1.0.0",
"version": "20.0.1.0.0",
"category": "Tools",
"complexity": "easy",
"author": "ADHOC SA",
Expand All @@ -30,8 +30,8 @@
"portal",
],
"data": [
"security/ir.model.access.csv",
"security/ir.access.csv",
],
"installable": False,
"installable": True,
"auto_install": True,
}
86 changes: 86 additions & 0 deletions portal_partner_state/i18n/es.po
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,89 @@ msgstr ""
"Language-Team: Spanish (https://app.transifex.com/adhoc/teams/46451/es/)\n"
"Language: es\n"
"Plural-Forms: nplurals=3; plural=n == 1 ? 0 : n != 0 && n % 1000000 == 0 ? 1 : 2;\n"

#. module: portal_partner_state
#: model:ir.module.module,description:base.module_portal_partner_state
msgid ""
".. |company| replace:: ADHOC SA\n"
"\n"
".. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png\n"
" :alt: ADHOC SA\n"
" :target: https://www.adhoc.com.ar\n"
"\n"
".. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png\n"
"\n"
".. image:: https://img.shields.io/badge/license-AGPL--3-blue.png\n"
" :target: https://www.gnu.org/licenses/agpl\n"
" :alt: License: AGPL-3\n"
"\n"
"=========================\n"
"Portal with Partner State\n"
"=========================\n"
"\n"
"This module integrate partner state using portal.\n"
"\n"
"#. Add a model access rule in order to able portal users to see the portal:\n"
" portal users can read the Partner State Fields configuration and the\n"
" fields it points to, but can not modify it.\n"
"\n"
"Installation\n"
"============\n"
"\n"
"To install this module, you need to:\n"
"\n"
"#. Just install this module. It is installed automatically when both\n"
" \"Partner State\" and \"Portal\" are installed.\n"
"\n"
"Configuration\n"
"=============\n"
"\n"
"To configure this module, you need to:\n"
"\n"
"#. Just install this module.\n"
"\n"
"Usage\n"
"=====\n"
"\n"
"To use this module, you need to:\n"
"\n"
"#. Log in with a user with the portal group.\n"
"#. Check if you can see the portal.\n"
"\n"
".. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas\n"
" :alt: Try me on Runbot\n"
" :target: http://runbot.adhoc.com.ar/\n"
"\n"
"Bug Tracker\n"
"===========\n"
"\n"
"Bugs are tracked on `GitHub Issues\n"
"<https://github.com/ingadhoc/partner/issues>`_. In case of trouble, please\n"
"check there if your issue has already been reported. If you spotted it first,\n"
"help us smashing it by providing a detailed and welcomed feedback.\n"
"\n"
"Credits\n"
"=======\n"
"\n"
"Images\n"
"------\n"
"\n"
"* |company| |icon|\n"
"\n"
"Contributors\n"
"------------\n"
"\n"
"Maintainer\n"
"----------\n"
"\n"
"|company_logo|\n"
"\n"
"This module is maintained by the |company|.\n"
"\n"
"To contribute to this module, please visit https://www.adhoc.com.ar.\n"
msgstr ""

#. module: portal_partner_state
#: model:ir.module.module,shortdesc:base.module_portal_partner_state
msgid "Portal Partner State"
msgstr "Estado de Empresas en el portal"
102 changes: 102 additions & 0 deletions portal_partner_state/i18n/portal_partner_state.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * portal_partner_state
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 20.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-10-19 21:13+0000\n"
"PO-Revision-Date: 2026-10-19 21:13+0000\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"

#. module: portal_partner_state
#: model:ir.module.module,description:base.module_portal_partner_state
msgid ""
".. |company| replace:: ADHOC SA\n"
"\n"
".. |company_logo| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-logo.png\n"
" :alt: ADHOC SA\n"
" :target: https://www.adhoc.com.ar\n"
"\n"
".. |icon| image:: https://raw.githubusercontent.com/ingadhoc/maintainer-tools/master/resources/adhoc-icon.png\n"
"\n"
".. image:: https://img.shields.io/badge/license-AGPL--3-blue.png\n"
" :target: https://www.gnu.org/licenses/agpl\n"
" :alt: License: AGPL-3\n"
"\n"
"=========================\n"
"Portal with Partner State\n"
"=========================\n"
"\n"
"This module integrate partner state using portal.\n"
"\n"
"#. Add a model access rule in order to able portal users to see the portal:\n"
" portal users can read the Partner State Fields configuration and the\n"
" fields it points to, but can not modify it.\n"
"\n"
"Installation\n"
"============\n"
"\n"
"To install this module, you need to:\n"
"\n"
"#. Just install this module. It is installed automatically when both\n"
" \"Partner State\" and \"Portal\" are installed.\n"
"\n"
"Configuration\n"
"=============\n"
"\n"
"To configure this module, you need to:\n"
"\n"
"#. Just install this module.\n"
"\n"
"Usage\n"
"=====\n"
"\n"
"To use this module, you need to:\n"
"\n"
"#. Log in with a user with the portal group.\n"
"#. Check if you can see the portal.\n"
"\n"
".. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas\n"
" :alt: Try me on Runbot\n"
" :target: http://runbot.adhoc.com.ar/\n"
"\n"
"Bug Tracker\n"
"===========\n"
"\n"
"Bugs are tracked on `GitHub Issues\n"
"<https://github.com/ingadhoc/partner/issues>`_. In case of trouble, please\n"
"check there if your issue has already been reported. If you spotted it first,\n"
"help us smashing it by providing a detailed and welcomed feedback.\n"
"\n"
"Credits\n"
"=======\n"
"\n"
"Images\n"
"------\n"
"\n"
"* |company| |icon|\n"
"\n"
"Contributors\n"
"------------\n"
"\n"
"Maintainer\n"
"----------\n"
"\n"
"|company_logo|\n"
"\n"
"This module is maintained by the |company|.\n"
"\n"
"To contribute to this module, please visit https://www.adhoc.com.ar.\n"
msgstr ""

#. module: portal_partner_state
#: model:ir.module.module,shortdesc:base.module_portal_partner_state
msgid "Portal Partner State"
msgstr ""
3 changes: 3 additions & 0 deletions portal_partner_state/security/ir.access.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
id,name,model_id,group_id/id,operation,domain
access_res_partner_state_field_portal,partner_state_field_portal,res.partner.state_field,base.group_portal,r,
access_ir_model_fields_portal,ir_model_fields,ir.model.fields,base.group_portal,r,"[('model', '=', 'res.partner')]"
3 changes: 0 additions & 3 deletions portal_partner_state/security/ir.model.access.csv

This file was deleted.

5 changes: 5 additions & 0 deletions portal_partner_state/tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from . import test_portal_partner_state
40 changes: 40 additions & 0 deletions portal_partner_state/tests/test_portal_partner_state.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
##############################################################################
# For copyright and license notices, see __manifest__.py file in module root
# directory
##############################################################################
from odoo.exceptions import AccessError
from odoo.tests import HttpCase, TransactionCase, new_test_user, tagged


@tagged("post_install", "-at_install")
class TestPortalPartnerState(TransactionCase):
@classmethod
def setUpClass(cls):
super().setUpClass()
cls.portal_user = new_test_user(cls.env, login="portal_partner_state", groups="base.group_portal")
field = cls.env["ir.model.fields"]._get("res.partner", "name")
cls.state_field = cls.env["res.partner.state_field"].create({"field_id": field.id})

def test_portal_reads_state_fields(self):
records = self.env["res.partner.state_field"].with_user(self.portal_user).search([])
self.assertIn(self.state_field, records)
self.assertEqual(records.field_id.mapped("name"), records.sudo().field_id.mapped("name"))

def test_portal_cannot_write_state_fields(self):
with self.assertRaises(AccessError):
self.state_field.with_user(self.portal_user).write({"approval": False})

def test_portal_reads_only_partner_fields(self):
fields = self.env["ir.model.fields"].with_user(self.portal_user).search([])
self.assertTrue(fields)
self.assertEqual(set(fields.mapped("model")), {"res.partner"})


@tagged("post_install", "-at_install")
class TestPortalPartnerStateHttp(HttpCase):
def test_portal_home(self):
new_test_user(self.env, login="portal_partner_state", groups="base.group_portal")
self.authenticate("portal_partner_state", "portal_partner_state")
response = self.url_open("/my")
self.assertEqual(response.status_code, 200)
self.assertTrue(response.url.endswith("/my"), "the portal user was redirected to the login")
Loading