Skip to content
Open
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
38 changes: 21 additions & 17 deletions res_partner_operating_unit/README.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

===========================
Partner with Operating Unit
===========================
Expand All @@ -13,7 +17,7 @@ Partner with Operating Unit
.. |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-LGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/license-LGPL--3-blue.png
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Foperating--unit-lightgray.png?logo=github
Expand All @@ -30,11 +34,11 @@ Partner with Operating Unit

This module introduces the following features:

- Adds the Operating Unit (OU) to res partner.
- The user’s default Operating Unit (OU) is proposed at the time of
creating Partner.
- Security rules are defined to ensure that users can only see Partner
of that Operating Units in which they are allowed access to.
- Adds the Operating Unit (OU) to res partner.
- The user’s default Operating Unit (OU) is proposed at the time of
creating Partner.
- Security rules are defined to ensure that users can only see Partner
of that Operating Units in which they are allowed access to.

**Table of contents**

Expand All @@ -44,9 +48,9 @@ This module introduces the following features:
Usage
=====

- Go to customer
- You only see the customer of your operating units
- Create an customer. It is assigned to your default operating unit.
- Go to customer
- You only see the customer of your operating units
- Create an customer. It is assigned to your default operating unit.

Bug Tracker
===========
Expand All @@ -71,18 +75,18 @@ Authors
Contributors
------------

- Edi Santoso <repodevs@gmail.com>
- Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
- Hiren Dangar <hiren.dangar.serpentcs@gmail.com>
- Ammar Officewala <aofficewala@opensourceintegrators.com>
- Freni Patel <fpatel@@opensourceintegrators.com>
- Edi Santoso <repodevs@gmail.com>
- Maxime Chambreuil <mchambreuil@opensourceintegrators.com>
- Hiren Dangar <hiren.dangar.serpentcs@gmail.com>
- Ammar Officewala <aofficewala@opensourceintegrators.com>
- Freni Patel <fpatel@@opensourceintegrators.com>

Other credits
-------------

- Niaga Solution
- Open Source Integrators
- Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>
- Niaga Solution
- Open Source Integrators
- Serpent Consulting Services Pvt. Ltd. <support@serpentcs.com>

Maintainers
-----------
Expand Down
1 change: 0 additions & 1 deletion res_partner_operating_unit/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from . import models
from .hooks import pre_init_hook
3 changes: 1 addition & 2 deletions res_partner_operating_unit/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Partner with Operating Unit",
"summary": "Introduces Operating Unit fields in Partner",
"version": "17.0.1.1.0",
"version": "17.0.1.2.0",
"author": "Edi Santoso, "
"Niaga Solution, "
"Serpent Consulting Services Pvt. Ltd., "
Expand All @@ -15,5 +15,4 @@
"license": "LGPL-3",
"data": ["security/res_partner_security.xml", "views/res_partner_view.xml"],
"installable": True,
"pre_init_hook": "pre_init_hook",
}
23 changes: 0 additions & 23 deletions res_partner_operating_unit/hooks.py

This file was deleted.

20 changes: 20 additions & 0 deletions res_partner_operating_unit/migrations/17.0.1.2.0/post-migrate.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright 2026 Camptocamp SA (https://www.camptocamp.com).
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).


def migrate(cr, version):
if not version:
return
# Add missing index in operating_unit_partner_rel
# Prior to this version, the pre_init_hook manually created the relation table,
# bypassing the ORM's automatic creation, and so causing the indexes to be missing.
# See: https://github.com/odoo/odoo/blob/7d146774c/odoo/fields.py#L4804-L4817
#
# The pre_init_hook is now removed, but we still need to create the index manually.
cr.execute(
"""
CREATE INDEX IF NOT EXISTS
operating_unit_partner_rel_partner_id_operating_unit_id_idx
ON operating_unit_partner_rel (partner_id, operating_unit_id)
"""
)
1 change: 0 additions & 1 deletion res_partner_operating_unit/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ def _default_operating_unit(self):
"partner_id",
"operating_unit_id",
"Operating Units",
required=True,
default=lambda self: self._default_operating_unit(),
)
28 changes: 17 additions & 11 deletions res_partner_operating_unit/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Partner with Operating Unit</title>
<title>README.rst</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,16 +360,21 @@
</style>
</head>
<body>
<div class="document" id="partner-with-operating-unit">
<h1 class="title">Partner with Operating Unit</h1>
<div class="document">


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="partner-with-operating-unit">
<h1>Partner with Operating Unit</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:b2fb05921796b54cfa83e8fec6e5ebd4e371bc2ea922120cdcbaece1712c6f7e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/operating-unit/tree/17.0/res_partner_operating_unit"><img alt="OCA/operating-unit" src="https://img.shields.io/badge/github-OCA%2Foperating--unit-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/operating-unit-17-0/operating-unit-17-0-res_partner_operating_unit"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/operating-unit&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" 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 image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/license-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/operating-unit/tree/17.0/res_partner_operating_unit"><img alt="OCA/operating-unit" src="https://img.shields.io/badge/github-OCA%2Foperating--unit-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/operating-unit-17-0/operating-unit-17-0-res_partner_operating_unit"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/operating-unit&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module introduces the following features:</p>
<ul class="simple">
<li>Adds the Operating Unit (OU) to res partner.</li>
Expand All @@ -393,33 +398,33 @@ <h1 class="title">Partner with Operating Unit</h1>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<h2><a class="toc-backref" href="#toc-entry-1">Usage</a></h2>
<ul class="simple">
<li>Go to customer</li>
<li>You only see the customer of your operating units</li>
<li>Create an customer. It is assigned to your default operating unit.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<h2><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h2>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/operating-unit/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 to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/operating-unit/issues/new?body=module:%20res_partner_operating_unit%0Aversion:%2017.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">
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<h2><a class="toc-backref" href="#toc-entry-3">Credits</a></h2>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-4">Authors</a></h3>
<ul class="simple">
<li>Edi Santoso</li>
<li>Niaga Solution</li>
<li>Serpent Consulting Services Pvt. Ltd.</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<h3><a class="toc-backref" href="#toc-entry-5">Contributors</a></h3>
<ul class="simple">
<li>Edi Santoso &lt;<a class="reference external" href="mailto:repodevs&#64;gmail.com">repodevs&#64;gmail.com</a>&gt;</li>
<li>Maxime Chambreuil &lt;<a class="reference external" href="mailto:mchambreuil&#64;opensourceintegrators.com">mchambreuil&#64;opensourceintegrators.com</a>&gt;</li>
Expand All @@ -429,15 +434,15 @@ <h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
</ul>
</div>
<div class="section" id="other-credits">
<h2><a class="toc-backref" href="#toc-entry-6">Other credits</a></h2>
<h3><a class="toc-backref" href="#toc-entry-6">Other credits</a></h3>
<ul class="simple">
<li>Niaga Solution</li>
<li>Open Source Integrators</li>
<li>Serpent Consulting Services Pvt. Ltd. &lt;<a class="reference external" href="mailto:support&#64;serpentcs.com">support&#64;serpentcs.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -450,5 +455,6 @@ <h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
</div>
</div>
</div>
</div>
</body>
</html>
Loading