[ADD] create `project_user_default_project` add-on

This commit is contained in:
Stéphan Sainléger
2022-08-25 18:00:35 +02:00
parent 5ad7c22034
commit 3b045229d1
9 changed files with 183 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
*.*~
*pyc

View File

@@ -0,0 +1,44 @@
============================
project_user_default_project
============================
Add default project field in user model
Installation
============
Use Odoo normal module installation procedure to install
``project_user_default_project``.
Known issues / Roadmap
======================
None yet.
Bug Tracker
===========
Bugs are tracked on `our issues website <https://github.com/elabore-coop/project-tools/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.
Credits
=======
Contributors
------------
* Stéphan Sainléger
Funders
-------
The development of this module has been financially supported by:
* Elabore (https://elabore.coop)
Maintainer
----------
This module is maintained by Elabore.

View File

@@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import models

View File

@@ -0,0 +1,86 @@
# Copyright 2022 Stéphan Sainléger (Elabore)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "project_user_default_project",
"version": "12.0.1.0.0",
"author": "Elabore",
"website": "https://elabore.coop",
"maintainer": "Stéphan Sainléger",
"license": "AGPL-3",
"category": "Tools",
"summary": "Add default project field in user model",
"description": """
:image: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
============================
project_user_default_project
============================
Add default project field in user model
Installation
============
Use Odoo normal module installation procedure to install
``project_user_default_project``.
Known issues / Roadmap
======================
None yet.
Bug Tracker
===========
Bugs are tracked on `our issues website <https://github.com/elabore-coop/project-tools/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.
Credits
=======
Contributors
------------
* Stéphan Sainléger
Funders
-------
The development of this module has been financially supported by:
* Elabore (https://elabore.coop)
Maintainer
----------
This module is maintained by Elabore.
""",
# any module necessary for this one to work correctly
"depends": [
"base", "project",
],
"qweb": [
# "static/src/xml/*.xml",
],
"external_dependencies": {
"python": [],
},
# always loaded
"data": [
"views/res_users_views.xml",
],
# only loaded in demonstration mode
"demo": [],
"js": [],
"css": [],
"installable": True,
# Install this module automatically if all dependency have been previously
# and independently installed. Used for synergetic or glue modules.
"auto_install": False,
"application": False,
}

View File

@@ -0,0 +1 @@
This directory should contain the *.po for Odoo translation.

View File

@@ -0,0 +1,27 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_user_default_project
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 12.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-08-25 15:58+0000\n"
"PO-Revision-Date: 2022-08-25 15:58+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: project_user_default_project
#: model:ir.model.fields,field_description:project_user_default_project.field_res_users__default_project_id
msgid "Default Project"
msgstr "Projet par défaut"
#. module: project_user_default_project
#: model:ir.model,name:project_user_default_project.model_res_users
msgid "Users"
msgstr "Utilisateurs"

View File

@@ -0,0 +1 @@
from . import res_users

View File

@@ -0,0 +1,6 @@
from odoo import _, api, fields, models
class Users(models.Model):
_inherit = "res.users"
default_project_id = fields.Many2one('project.project', string='Default Project')

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<record id="view_users_form_inherit_default_project" model="ir.ui.view">
<field name="name">view.users.form.inherit.default.project</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='action_id']" position="after">
<field name="default_project_id" />
</xpath>
</field>
</record>
</odoo>