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
98 changes: 98 additions & 0 deletions default_multi_user/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

==================
Default Multi User
==================

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

.. |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/license-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%2Fserver--ux-lightgray.png?logo=github
:target: https://github.com/OCA/server-ux/tree/19.0/default_multi_user
:alt: OCA/server-ux
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/server-ux-19-0/server-ux-19-0-default_multi_user
: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/server-ux&target_branch=19.0
:alt: Try me on Runboat

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

Allows to share user-defined defaults among several users.

**Table of contents**

.. contents::
:local:

Configuration
=============

To share a default among several users you need to:

1. Go to *Settings > Technical > Actions > User-defined Defaults*.
2. Edit a default and fill the field *Available for users* and
*Available for Groups* with the desired users and/or groups.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/server-ux/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/server-ux/issues/new?body=module:%20default_multi_user%0Aversion:%2019.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
-------

* ForgeFlow

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

- Lois Rilo <lois.rilo@forgeflow.com>
- Sunanda Chhatbar <sunanda.chhatbar@initos.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.

.. |maintainer-LoisRForgeFlow| image:: https://github.com/LoisRForgeFlow.png?size=40px
:target: https://github.com/LoisRForgeFlow
:alt: LoisRForgeFlow

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-LoisRForgeFlow|

This module is part of the `OCA/server-ux <https://github.com/OCA/server-ux/tree/19.0/default_multi_user>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions default_multi_user/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from .hooks import post_load_hook
17 changes: 17 additions & 0 deletions default_multi_user/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright 2020 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
{
"name": "Default Multi User",
"summary": "Allows to share user-defined defaults among several users.",
"version": "19.0.1.0.0",
"development_status": "Beta",
"maintainers": ["LoisRForgeFlow"],
"category": "Tools",
"website": "https://github.com/OCA/server-ux",
"author": "ForgeFlow, Odoo Community Association (OCA)",
"license": "AGPL-3",
"installable": True,
"depends": ["base"],
"data": ["views/ir_default_view.xml"],
"post_load": "post_load_hook",
}
33 changes: 33 additions & 0 deletions default_multi_user/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Copyright 2020-24 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

import json

from odoo import api, tools

from odoo.addons.base.models.ir_default import IrDefault


def post_load_hook():
@api.model
@tools.ormcache("self.env.uid", "self.env.company.id", "model_name", "condition")
def new_get_model_defaults(self, model_name, condition=False):
if not hasattr(self, "_get_model_defaults_query_and_params"):
return self.get_model_defaults_original(model_name, condition=condition)
cr = self.env.cr
self.flush_model()
# START OF CHANGES
query, params = self._get_model_defaults_query_and_params(model_name, condition)
# END OF CHANGES
cr.execute(query, params)
result = {}
for row in cr.fetchall():
# keep the highest priority default for each field
if row[0] not in result:
result[row[0]] = json.loads(row[1])
return result

if not hasattr(IrDefault, "get_model_defaults_original"):
IrDefault.get_model_defaults_original = IrDefault._get_model_defaults

IrDefault._get_model_defaults = new_get_model_defaults
40 changes: 40 additions & 0 deletions default_multi_user/i18n/default_multi_user.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * default_multi_user
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.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"

#. module: default_multi_user
#: model:ir.model.fields,field_description:default_multi_user.field_ir_default__group_ids
msgid "Available for Groups"
msgstr ""

#. module: default_multi_user
#: model:ir.model.fields,field_description:default_multi_user.field_ir_default__manual_user_ids
#: model_terms:ir.ui.view,arch_db:default_multi_user.ir_default_view_tree
msgid "Available for Users"
msgstr ""

#. module: default_multi_user
#: model:ir.model,name:default_multi_user.model_ir_default
msgid "Default Values"
msgstr ""

#. module: default_multi_user
#: model_terms:ir.ui.view,arch_db:default_multi_user.ir_default_view_form
msgid "Owner"
msgstr ""

#. module: default_multi_user
#: model:ir.model.fields,field_description:default_multi_user.field_ir_default__user_ids
msgid "Users"
msgstr ""
52 changes: 52 additions & 0 deletions default_multi_user/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * default_multi_user
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-03-16 11:46+0000\n"
"Last-Translator: Ana Suárez <ana.suarez@qubiq.es>\n"
"Language-Team: none\n"
"Language: es\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"
"X-Generator: Weblate 4.3.2\n"

#. module: default_multi_user
#: model:ir.model.fields,field_description:default_multi_user.field_ir_default__group_ids
msgid "Available for Groups"
msgstr "Disponible para Grupos"

#. module: default_multi_user
#: model:ir.model.fields,field_description:default_multi_user.field_ir_default__manual_user_ids
#: model_terms:ir.ui.view,arch_db:default_multi_user.ir_default_view_tree
msgid "Available for Users"
msgstr "Disponible para Usuarios"

#. module: default_multi_user
#: model:ir.model,name:default_multi_user.model_ir_default
msgid "Default Values"
msgstr "Valores por defecto"

#. module: default_multi_user
#: model_terms:ir.ui.view,arch_db:default_multi_user.ir_default_view_form
msgid "Owner"
msgstr "Propietario"

#. module: default_multi_user
#: model:ir.model.fields,field_description:default_multi_user.field_ir_default__user_ids
msgid "Users"
msgstr "Usuarios"

#~ msgid "Display Name"
#~ msgstr "Nombre mostrado"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Última modificación el"
43 changes: 43 additions & 0 deletions default_multi_user/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * default_multi_user
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 18.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2025-08-16 13:25+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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"
"X-Generator: Weblate 5.10.4\n"

#. module: default_multi_user
#: model:ir.model.fields,field_description:default_multi_user.field_ir_default__group_ids
msgid "Available for Groups"
msgstr "Disponibile per i gruppi"

#. module: default_multi_user
#: model:ir.model.fields,field_description:default_multi_user.field_ir_default__manual_user_ids
#: model_terms:ir.ui.view,arch_db:default_multi_user.ir_default_view_tree
msgid "Available for Users"
msgstr "Disponibile per gli utenti"

#. module: default_multi_user
#: model:ir.model,name:default_multi_user.model_ir_default
msgid "Default Values"
msgstr "Valori predefiniti"

#. module: default_multi_user
#: model_terms:ir.ui.view,arch_db:default_multi_user.ir_default_view_form
msgid "Owner"
msgstr "Proprietario"

#. module: default_multi_user
#: model:ir.model.fields,field_description:default_multi_user.field_ir_default__user_ids
msgid "Users"
msgstr "Utenti"
52 changes: 52 additions & 0 deletions default_multi_user/i18n/pt.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * default_multi_user
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2021-07-02 22:51+0000\n"
"Last-Translator: Pedro Castro Silva <pedrocs@exo.pt>\n"
"Language-Team: none\n"
"Language: pt\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"
"X-Generator: Weblate 4.3.2\n"

#. module: default_multi_user
#: model:ir.model.fields,field_description:default_multi_user.field_ir_default__group_ids
msgid "Available for Groups"
msgstr "Disponível para Grupos"

#. module: default_multi_user
#: model:ir.model.fields,field_description:default_multi_user.field_ir_default__manual_user_ids
#: model_terms:ir.ui.view,arch_db:default_multi_user.ir_default_view_tree
msgid "Available for Users"
msgstr "Disponível para Utilizadores"

#. module: default_multi_user
#: model:ir.model,name:default_multi_user.model_ir_default
msgid "Default Values"
msgstr "Valore Pré-definidos"

#. module: default_multi_user
#: model_terms:ir.ui.view,arch_db:default_multi_user.ir_default_view_form
msgid "Owner"
msgstr "Proprietário"

#. module: default_multi_user
#: model:ir.model.fields,field_description:default_multi_user.field_ir_default__user_ids
msgid "Users"
msgstr "Utilizadores"

#~ msgid "Display Name"
#~ msgstr "Nome a Exibir"

#~ msgid "ID"
#~ msgstr "ID"

#~ msgid "Last Modified on"
#~ msgstr "Última Modificação em"
1 change: 1 addition & 0 deletions default_multi_user/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import ir_default
Loading
Loading