Compare commits
19 Commits
project_us
...
16.0-proje
Author | SHA1 | Date | |
---|---|---|---|
|
5d74a26247 | ||
|
93a6768716 | ||
|
16c1da3c42 | ||
|
792c3d602a | ||
|
a06cd29014 | ||
|
e9ec522405 | ||
|
6dc94c02fa | ||
|
0e36b3d9e3 | ||
|
a240b6cf71 | ||
|
2cd17ce8ef | ||
|
eb85069ff8 | ||
|
38e12ee2ed | ||
|
15b21771dd | ||
|
e6595ec6f7 | ||
45e38de4ff | |||
1a342d3b8b | |||
0bff01ad76 | |||
cd884b967e | |||
22a703d9bd |
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "project_assignees",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "16.0.1.1.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://github.com/elabore-coop/project-tools",
|
||||
"maintainer": "Stéphan Sainléger",
|
||||
@@ -69,6 +69,7 @@ This module is maintained by Elabore.
|
||||
"depends": [
|
||||
"base",
|
||||
"project",
|
||||
"project_task_portal_form",
|
||||
],
|
||||
"qweb": [
|
||||
# "static/src/xml/*.xml",
|
||||
|
@@ -4,10 +4,10 @@
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Project-Id-Version: Odoo Server 16.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-07-26 07:38+0000\n"
|
||||
"PO-Revision-Date: 2022-07-26 07:38+0000\n"
|
||||
"POT-Creation-Date: 2023-11-02 07:56+0000\n"
|
||||
"PO-Revision-Date: 2023-11-02 07:56+0000\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
@@ -16,17 +16,21 @@ msgstr ""
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: project_assignees
|
||||
#: model_terms:ir.ui.view,arch_db:project_assignees.portal_my_task_timebox
|
||||
msgid "<strong>Other assignements</strong>"
|
||||
#: model_terms:ir.ui.view,arch_db:project_assignees.portal_my_task_assignees
|
||||
msgid "<strong>Other assignees</strong>"
|
||||
msgstr "<strong>Autres intervenants</strong>"
|
||||
|
||||
#. module: project_assignees
|
||||
#: model:ir.model.fields,field_description:project_assignees.field_project_task__assignee_ids |
|
||||
msgid "Assignees" |
|
||||
#: model:ir.model.fields,field_description:project_assignees.field_project_task__assignee_ids
|
||||
msgid "Assignees"
|
||||
msgstr "Autres assignations"
|
||||
|
||||
#. module: project_assignees
|
||||
#: model_terms:ir.ui.view,arch_db:project_assignees.portal_my_task_assignees
|
||||
msgid "Contact"
|
||||
msgstr ""
|
||||
|
||||
#. module: project_assignees
|
||||
#: model:ir.model,name:project_assignees.model_project_task
|
||||
msgid "Task"
|
||||
msgstr "Tâche"
|
||||
|
||||
msgstr "Tâche"
|
@@ -1,21 +1,20 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="portal_my_task_assignees" name="My Task: Assignees" inherit_id="project.portal_my_task" priority="40">
|
||||
<xpath expr="//div[hasclass('flex-grow-0')]/../../.." position="inside">
|
||||
<div class="col-12 col-md-6 pb-2" t-if="task.assignee_ids">
|
||||
<xpath expr="//t[@t-foreach='task.user_ids']" position="after">
|
||||
<div class="col-12 col-md-12 pb-2" t-if="task.assignee_ids">
|
||||
<strong>Other assignees</strong>
|
||||
<div class="row">
|
||||
<t t-foreach="task.assignee_ids" t-as="assignee">
|
||||
<div class="col flex-grow-0 pr-3">
|
||||
<img t-if="assignee.image" class="rounded-circle mt-1 o_portal_contact_img" t-att-src="image_data_uri(assignee.image)" alt="Contact" />
|
||||
<img t-else="" class="rounded-circle mt-1 o_portal_contact_img" src="/web/static/src/img/user_menu_avatar.png" alt="Contact" />
|
||||
</div>
|
||||
<div class="col pl-md-0">
|
||||
<strong>
|
||||
<span t-field="assignee.name" />
|
||||
</strong>
|
||||
<span t-field="assignee.email" />
|
||||
<span t-field="assignee.phone" />
|
||||
<t t-foreach="task.assignee_ids" t-as="user">
|
||||
<div class="d-flex mb-3 flex-nowrap">
|
||||
<img class="rounded-circle mt-1 o_portal_contact_img" t-att-src="image_data_uri(user.avatar_1024)" alt="Contact"/>
|
||||
<div class="ms-2">
|
||||
<div t-esc="user" t-options='{"widget": "contact", "fields": ["name"]}'/>
|
||||
<a t-attf-href="tel:{{user.phone}}" t-if="user.phone"><div t-esc="user" t-options='{"widget": "contact", "fields": ["phone"]}'/></a>
|
||||
<a t-if="user.email" class="text-break" t-attf-href="mailto:{{user.email}}">
|
||||
<div t-out="user" t-options='{"widget": "contact", "fields": ["email"]}'/>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
</div>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<field name="inherit_id" ref="project.view_task_form2" />
|
||||
<field name="priority" eval="99" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='user_id']" position="after">
|
||||
<xpath expr="//field[@name='user_ids']" position="after">
|
||||
<field name="assignee_ids" widget="many2many_tags" />
|
||||
</xpath>
|
||||
</field>
|
||||
@@ -19,8 +19,11 @@
|
||||
<field name="priority" eval="99" />
|
||||
<field name="arch" type="xml">
|
||||
<filter name="my_tasks" position="attributes">
|
||||
<attribute name="domain">['|', ('user_id', '=', uid), ('assignee_ids', 'in', uid)]</attribute>
|
||||
<attribute name="domain">['|', ('user_ids', 'in', uid), ('assignee_ids', 'in', uid)]</attribute>
|
||||
</filter>
|
||||
<xpath expr="//field[@name='partner_id']" position="after">
|
||||
<field name="assignee_ids" filter_domain="[('assignee_ids.user_ids.name', 'ilike', self)]"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "project_average_acceptable_time",
|
||||
"version": "12.0.1.0.0",
|
||||
"version": "16.0.1.0.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://github.com/elabore-coop/project-tools",
|
||||
"maintainer": "Clément Thomas",
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<field name="inherit_id" ref="project.view_project_kanban"/>
|
||||
<field name="priority">999</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//div[@class='o_project_kanban_main']" position="inside">
|
||||
<xpath expr="//div[@class='o_project_kanban_main ']" position="inside">
|
||||
<div class="o_project_kanban_boxes">
|
||||
<span>Average acceptable time:<![CDATA[ ]]></span>
|
||||
<field name="average_acceptable_time" widget="float_time"/>
|
||||
@@ -23,10 +23,14 @@
|
||||
<field name="model">project.project</field>
|
||||
<field name="inherit_id" ref="project.edit_project"/>
|
||||
<field name="arch" type="xml">
|
||||
<field name="subtask_project_id" position="after">
|
||||
<label for="average_acceptable_time" />
|
||||
<field name="average_acceptable_time" widget="float_time"/>
|
||||
</field>
|
||||
<xpath expr="//div[@id='subtask_settings']/div[@class='o_setting_right_pane']" position="inside">
|
||||
<div class="o_settings_average_acceptable_time" style="margin-top:10px;">
|
||||
<!-- <span>Average acceptable time:<![CDATA[ ]]></span> -->
|
||||
<label for="average_acceptable_time"/>
|
||||
<field name="average_acceptable_time" widget="float_time"/>
|
||||
</div>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
43
project_disable_last_sol_as_sol_by_default/README.rst
Normal file
43
project_disable_last_sol_as_sol_by_default/README.rst
Normal file
@@ -0,0 +1,43 @@
|
||||
==========================================
|
||||
project_disable_last_sol_as_sol_by_default
|
||||
==========================================
|
||||
|
||||
If there is no sale order line in a task, do not add automaticly the last sol of customer as the sale order line by default
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
Use Odoo normal module installation procedure to install ``project_disable_last_sol_as_sol_by_default``.
|
||||
|
||||
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
|
||||
------------
|
||||
|
||||
* Laetitia Da Costa (https://github.com/LaetitiaElabore)
|
||||
|
||||
Funders
|
||||
-------
|
||||
|
||||
The development of this module has been financially supported by:
|
||||
* Elabore (https://elabore.coop)
|
||||
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
|
||||
This module is maintained by Elabore.
|
1
project_disable_last_sol_as_sol_by_default/__init__.py
Normal file
1
project_disable_last_sol_as_sol_by_default/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import models
|
37
project_disable_last_sol_as_sol_by_default/__manifest__.py
Normal file
37
project_disable_last_sol_as_sol_by_default/__manifest__.py
Normal file
@@ -0,0 +1,37 @@
|
||||
# Copyright 2022 Stéphan Sainléger (Elabore)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "project_disable_last_sol_as_sol_by_default",
|
||||
"version": "14.0.1.0.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://elabore.coop",
|
||||
"maintainer": "Laetitia Da Costa",
|
||||
"license": "AGPL-3",
|
||||
"category": "Project",
|
||||
"summary": "Do not add last sale order line automaticly as the sale order line by default in a task",
|
||||
# any module necessary for this one to work correctly
|
||||
"depends": [
|
||||
"base",
|
||||
"project",
|
||||
"sale_timesheet"
|
||||
],
|
||||
"qweb": [
|
||||
# "static/src/xml/*.xml",
|
||||
],
|
||||
"external_dependencies": {
|
||||
"python": [],
|
||||
},
|
||||
# always loaded
|
||||
"data": [
|
||||
],
|
||||
# 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,
|
||||
}
|
@@ -0,0 +1 @@
|
||||
from . import project_task
|
@@ -0,0 +1,7 @@
|
||||
from odoo import models
|
||||
|
||||
class Task(models.Model):
|
||||
_inherit = "project.task"
|
||||
|
||||
def _get_last_sol_of_customer(self):
|
||||
return False
|
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "project_funders",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "16.0.1.0.0",
|
||||
"author": "Alusage",
|
||||
"website": "https://alusage.fr",
|
||||
"data": [
|
||||
|
@@ -1,3 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import models
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "project_link_from_invoice",
|
||||
"version": "14.0.0.0.0",
|
||||
"version": "16.0.1.0.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://github.com/elabore-coop/project-tools",
|
||||
"maintainer": "Clément Thomas",
|
||||
|
@@ -1,3 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import account_move
|
@@ -1,3 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import models
|
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "project_name_from_lead",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "16.0.1.0.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://elabore.coop",
|
||||
"maintainer": "Clément Thomas",
|
||||
@@ -13,6 +13,7 @@
|
||||
# any module necessary for this one to work correctly
|
||||
"depends": [
|
||||
"base",
|
||||
"crm",
|
||||
"sale_project",
|
||||
],
|
||||
"qweb": [
|
||||
|
@@ -1,3 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import models
|
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "project_name_from_quote",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "16.0.1.0.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://elabore.coop",
|
||||
"maintainer": "Stéphan Sainléger",
|
||||
|
0
project_parent_task/__init__.py
Normal file
0
project_parent_task/__init__.py
Normal file
@@ -1,70 +1,68 @@
|
||||
# Copyright 2022 Stéphan Sainléger (Elabore)
|
||||
# Copyright 2022 Laetitia Da Costa (Elabore)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
|
||||
{
|
||||
"name": "project_timesheet_funding_wish",
|
||||
"name": "project_parent_tasks",
|
||||
"version": "14.0.1.0.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://github.com/elabore-coop/project-tools",
|
||||
"maintainer": "Stéphan Sainléger",
|
||||
"website": "https://elabore.coop",
|
||||
"maintainer": "Laetitia Da Costa",
|
||||
"license": "AGPL-3",
|
||||
"category": "Tools",
|
||||
"summary": "Add a funding wish select field to timesheet line.",
|
||||
"category": "Project",
|
||||
"summary": "in parent's tasks dropdown field, show only tasks from the current projet",
|
||||
"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_timesheet_funding_wish
|
||||
==============================
|
||||
====================
|
||||
project_parent_tasks
|
||||
====================
|
||||
|
||||
Add a funding wish select field to timesheet line.
|
||||
when selecting a parent task in a task, display only tasks from the current project
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
Use Odoo normal procedure to install add-ons to install
|
||||
``project_timesheet_funding_wish``.
|
||||
Use Odoo normal module installation procedure to install ``project_parent_tasks``.
|
||||
|
||||
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
|
||||
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
|
||||
=======
|
||||
|
||||
Images
|
||||
------
|
||||
* Elabore: `Icon <https://elabore.coop/web/image/res.company/1/logo?unique=f3db262>`_.
|
||||
|
||||
Contributors
|
||||
------------
|
||||
* Stéphan Sainléger <https://github.com/stephansainleger>
|
||||
* Valentin Lab <valentin.lab@kalysto.org>
|
||||
* Nicolas Jeudy <https://github.com/njeudy>
|
||||
|
||||
* Laetitia Da Costa (https://github.com/LaetitiaElabore)
|
||||
|
||||
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",
|
||||
"hr_timesheet",
|
||||
"project",
|
||||
],
|
||||
"qweb": [
|
||||
# "static/src/xml/*.xml",
|
||||
@@ -74,7 +72,7 @@ This module is maintained by Elabore.
|
||||
},
|
||||
# always loaded
|
||||
"data": [
|
||||
"views/hr_timesheet.xml",
|
||||
"views/project_task.xml",
|
||||
],
|
||||
# only loaded in demonstration mode
|
||||
"demo": [],
|
||||
@@ -85,4 +83,4 @@ This module is maintained by Elabore.
|
||||
# and independently installed. Used for synergetic or glue modules.
|
||||
"auto_install": False,
|
||||
"application": False,
|
||||
}
|
||||
}
|
13
project_parent_task/views/project_task.xml
Normal file
13
project_parent_task/views/project_task.xml
Normal file
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<odoo>
|
||||
<record model="ir.ui.view" id="view_tasks_form2_parent_project_inherited">
|
||||
<field name="name">view.tasks.form2.parent.project.inherited</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="inherit_id" ref="project.view_task_form2" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//page[@name='extra_info']//field[@name='parent_id']" position="attributes">
|
||||
<attribute name="domain">[('project_id','=', project_id)]</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "project_request_data",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "16.0.1.2.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://elabore.coop",
|
||||
"maintainer": "Stéphan Sainléger",
|
||||
|
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="portal_my_task_request_data" name="My Task: Request Data" inherit_id="project.portal_my_task" priority="40">
|
||||
<xpath expr="//t[@t-set='card_body']/div[hasclass('row','mb-4')]" position="after">
|
||||
<xpath expr="//div[@id='card_body']/div[hasclass('row','mb-4','container')]" position="after">
|
||||
<div id="request_data" class="row mb-4">
|
||||
<div class="col-12 col-md-6" t-if="task.service_id">
|
||||
<strong>Service:</strong>
|
||||
|
@@ -12,4 +12,18 @@
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<record id="view_task_kanban_request_data" model="ir.ui.view">
|
||||
<field name="name">project.task.kanban.request.data</field>
|
||||
<field name="inherit_id" ref="project.view_task_kanban" />
|
||||
<field name="model">project.task</field>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='name']" position="before">
|
||||
<div style="font-size:11px; margin-bottom: 8px;"><field name="create_date" widget="date"/></div>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='tag_ids']" position="before">
|
||||
<span style="background:lightblue; font-size:11px"><field name="service_id"/></span>
|
||||
<span style="background:lightsteelblue; font-size:11px"><field name="request_type_id"/></span>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</odoo>
|
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "project_task_portal_form",
|
||||
"version": "14.0.1.1.0",
|
||||
"version": "16.0.1.1.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://elabore.coop",
|
||||
"maintainer": "Stéphan Sainléger",
|
||||
|
@@ -51,7 +51,7 @@ class PortalTaskCreation(CustomerPortal):
|
||||
website=True,
|
||||
)
|
||||
def portal_task_creation(self, access_token=None, redirect=None, **kw):
|
||||
values = self._task_get_page_view_values(request.env.user.partner_id, access_token, **kw)
|
||||
values = self._taskform_get_page_view_values(request.env.user.partner_id, access_token, **kw)
|
||||
request_types = request.env["request.type"].sudo().search([])
|
||||
task_services = request.env["task.service"].sudo().search([])
|
||||
priorities = self._get_task_priorities()
|
||||
@@ -105,7 +105,9 @@ class PortalTaskCreation(CustomerPortal):
|
||||
values = self._compute_form_data(kwargs)
|
||||
values["project_id"] = user.default_project_id.id
|
||||
values["partner_id"] = user.partner_id.id
|
||||
values["user_id"] = user.id
|
||||
values["user_ids"] = [(6, 0, [user.id])]
|
||||
|
||||
|
||||
|
||||
files = values.get("attachments", False)
|
||||
del values['attachments']
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "project_timebox",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "16.0.1.0.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://elabore.coop",
|
||||
"maintainer": "Stéphan Sainléger",
|
||||
|
@@ -1,13 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="portal_my_task_timebox" name="My Task: Timebox" inherit_id="project.portal_my_task" priority="40">
|
||||
<xpath expr="//t[@t-set='card_body']/div[hasclass('row','mb-4')]" position="before">
|
||||
<xpath expr="//div[@t-if='task.date_deadline']" position="after">
|
||||
<div id="timebox" class="row mb-2">
|
||||
<div class="col-12 col-md-6" t-if="task.timebox_min_id">
|
||||
<div t-if="task.timebox_min_id">
|
||||
<strong>Timebox Min:</strong>
|
||||
<span t-field="task.timebox_min_id" />
|
||||
</div>
|
||||
<div class="col-12 col-md-6" t-if="task.timebox_max_id">
|
||||
<div t-if="task.timebox_max_id">
|
||||
<strong>Timebox Max:</strong>
|
||||
<span t-field="task.timebox_max_id" />
|
||||
</div>
|
||||
|
@@ -1,47 +0,0 @@
|
||||
==============================
|
||||
project_timesheet_funding_wish
|
||||
==============================
|
||||
|
||||
Add a funding wish select field to timesheet line.
|
||||
|
||||
Installation
|
||||
============
|
||||
|
||||
Use Odoo normal procedure to install add-ons to install
|
||||
``project_timesheet_funding_wish``.
|
||||
|
||||
Known issues / Roadmap
|
||||
======================
|
||||
|
||||
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
|
||||
=======
|
||||
|
||||
Images
|
||||
------
|
||||
* Elabore: `Icon <https://elabore.coop/web/image/res.company/1/logo?unique=f3db262>`_.
|
||||
|
||||
Contributors
|
||||
------------
|
||||
* Stéphan Sainléger <https://github.com/stephansainleger>
|
||||
* Valentin Lab <valentin.lab@kalysto.org>
|
||||
* Nicolas Jeudy <https://github.com/njeudy>
|
||||
|
||||
Funders
|
||||
-------
|
||||
The development of this module has been financially supported by:
|
||||
* Elabore (https://elabore.coop)
|
||||
|
||||
|
||||
Maintainer
|
||||
----------
|
||||
This module is maintained by Elabore.
|
||||
|
||||
|
@@ -1 +0,0 @@
|
||||
from . import models
|
@@ -1 +0,0 @@
|
||||
This directory should contain the *.po for Odoo translation.
|
@@ -1,65 +0,0 @@
|
||||
# Translation of Odoo Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * project_timesheet_funding_wish
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Odoo Server 14.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2022-07-25 17:02+0000\n"
|
||||
"PO-Revision-Date: 2022-07-25 17:02+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_timesheet_funding_wish
|
||||
#: model:ir.model,name:project_timesheet_funding_wish.model_account_analytic_line
|
||||
msgid "Analytic Line"
|
||||
msgstr "Ligne analytique"
|
||||
|
||||
#. module: project_timesheet_funding_wish
|
||||
#: model:ir.model.fields,field_description:project_timesheet_funding_wish.field_account_analytic_line__display_name
|
||||
msgid "Display Name"
|
||||
msgstr "Nom affiché"
|
||||
|
||||
#. module: project_timesheet_funding_wish
|
||||
#: model:ir.model.fields.selection,name:project_timesheet_funding_wish.selection__account_analytic_line__funding_wish__free
|
||||
msgid "Free"
|
||||
msgstr "Offert"
|
||||
|
||||
#. module: project_timesheet_funding_wish
|
||||
#: code:addons/project_timesheet_funding_wish/models/hr_timesheet.py:0
|
||||
#: model:ir.model.fields,field_description:project_timesheet_funding_wish.field_account_analytic_line__funding_wish
|
||||
#, python-format
|
||||
msgid "Funding wish"
|
||||
msgstr "Type de financement"
|
||||
|
||||
#. module: project_timesheet_funding_wish
|
||||
#: model:ir.model.fields,field_description:project_timesheet_funding_wish.field_account_analytic_line__id
|
||||
msgid "ID"
|
||||
msgstr ""
|
||||
|
||||
#. module: project_timesheet_funding_wish
|
||||
#: model:ir.model.fields,field_description:project_timesheet_funding_wish.field_account_analytic_line____last_update
|
||||
msgid "Last Modified on"
|
||||
msgstr "Dernière modification le"
|
||||
|
||||
#. module: project_timesheet_funding_wish
|
||||
#: model:ir.model.fields.selection,name:project_timesheet_funding_wish.selection__account_analytic_line__funding_wish__accepted
|
||||
msgid "Payment accepted"
|
||||
msgstr "Paiement accepté"
|
||||
|
||||
#. module: project_timesheet_funding_wish
|
||||
#: model:ir.model.fields.selection,name:project_timesheet_funding_wish.selection__account_analytic_line__funding_wish__expected
|
||||
msgid "Payment expected"
|
||||
msgstr "Paiement attendu"
|
||||
|
||||
#. module: project_timesheet_funding_wish
|
||||
#: code:addons/project_timesheet_funding_wish/models/hr_timesheet.py:0
|
||||
#: model:ir.model.fields,field_description:project_timesheet_funding_wish.field_account_analytic_line__treated
|
||||
#, python-format
|
||||
msgid "Treated"
|
||||
msgstr "Traité"
|
@@ -1 +0,0 @@
|
||||
from . import hr_timesheet
|
@@ -1,16 +0,0 @@
|
||||
from odoo import _, fields, models
|
||||
|
||||
|
||||
class AccountAnalyticLine(models.Model):
|
||||
_inherit = "account.analytic.line"
|
||||
|
||||
funding_wish = fields.Selection(
|
||||
[
|
||||
("free", "Free"),
|
||||
("accepted", "Payment accepted"),
|
||||
("expected", "Payment expected"),
|
||||
],
|
||||
string=_("Funding wish"),
|
||||
copy=False,
|
||||
)
|
||||
treated = fields.Boolean(string=_("Treated"), copy=False)
|
@@ -1,27 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<record id="hr_timesheet_line_tree_funding_view" model="ir.ui.view">
|
||||
<field name="name">hr.timesheet.line.tree.funding.view</field>
|
||||
<field name="model">account.analytic.line</field>
|
||||
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='date']" position="after">
|
||||
<field name="treated" />
|
||||
<field name="funding_wish" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_task_form2_inherited_funding" model="ir.ui.view">
|
||||
<field name="name">view.task.form2.inherited.funding</field>
|
||||
<field name="model">project.task</field>
|
||||
<field name="inherit_id" ref="hr_timesheet.view_task_form2_inherited" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='timesheet_ids']/tree/field[@name='date']" position="after">
|
||||
<field name="treated" />
|
||||
<field name="funding_wish" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</odoo>
|
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "project_user_default_project",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "16.0.1.0.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://elabore.coop",
|
||||
"maintainer": "Stéphan Sainléger",
|
||||
|
@@ -1,3 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from . import models
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "project_visibility_followers_portal",
|
||||
"version": "14.0.1.0.0",
|
||||
"version": "16.0.1.0.0",
|
||||
"author": "Elabore",
|
||||
"website": "https://github.com/elabore-coop/project-tools",
|
||||
"maintainer": "Clément Thomas",
|
||||
@@ -77,7 +77,6 @@ This module is maintained by Elabore.
|
||||
},
|
||||
# always loaded
|
||||
"data": [
|
||||
"views/project_views.xml",
|
||||
"security/project_security.xml"
|
||||
],
|
||||
# only loaded in demonstration mode
|
||||
|
@@ -5,6 +5,7 @@ from odoo import models, fields, api
|
||||
class Project(models.Model):
|
||||
_inherit = "project.project"
|
||||
|
||||
# A reprendre pour ajouter l’option de visibilité
|
||||
privacy_visibility = fields.Selection(
|
||||
selection_add=[('followers_portal','Invited portal users and invited internal users')],
|
||||
ondelete={'followers_portal': 'set default'})
|
||||
@@ -16,7 +17,7 @@ class Project(models.Model):
|
||||
"""
|
||||
project = super(Project, self).create(vals)
|
||||
if project.privacy_visibility == 'followers_portal' and project.partner_id.user_ids:
|
||||
project.allowed_user_ids |= project.partner_id.user_ids
|
||||
project.message_partner_ids |= project.partner_id
|
||||
return project
|
||||
|
||||
def write(self, vals):
|
||||
@@ -26,5 +27,6 @@ class Project(models.Model):
|
||||
res = super(Project, self).write(vals)
|
||||
if vals.get('partner_id') or vals.get('privacy_visibility'):
|
||||
for project in self.filtered(lambda project: project.privacy_visibility == 'followers_portal'):
|
||||
project.allowed_user_ids |= project.partner_id.user_ids
|
||||
return res
|
||||
project.message_partner_ids |= project.partner_id
|
||||
return res
|
||||
|
||||
|
@@ -6,49 +6,20 @@ from odoo.exceptions import ValidationError
|
||||
class Task(models.Model):
|
||||
_inherit = "project.task"
|
||||
|
||||
@api.constrains('allowed_user_ids')
|
||||
@api.constrains('message_partner_ids')
|
||||
def _check_no_portal_allowed(self):
|
||||
for task in self.filtered(lambda t: t.project_id.privacy_visibility not in ('portal','followers_portal')):
|
||||
portal_users = task.allowed_user_ids.filtered('share')
|
||||
portal_users = task.message_partner_ids.user_ids.filtered('share')
|
||||
if portal_users:
|
||||
user_names = ', '.join(portal_users[:10].mapped('name'))
|
||||
raise ValidationError(_("The project visibility setting doesn't allow portal users to see the project's tasks. (%s)", user_names))
|
||||
|
||||
@api.depends('project_id.allowed_user_ids', 'project_id.privacy_visibility')
|
||||
def _compute_allowed_user_ids(self):
|
||||
for task in self.with_context(prefetch_fields=False):
|
||||
portal_users = task.allowed_user_ids.filtered('share')
|
||||
internal_users = task.allowed_user_ids - portal_users
|
||||
|
||||
if task.project_id.privacy_visibility == 'followers':
|
||||
task.allowed_user_ids |= task.project_id.allowed_internal_user_ids
|
||||
task.allowed_user_ids -= portal_users
|
||||
elif task.project_id.privacy_visibility == 'portal':
|
||||
task.allowed_user_ids |= task.project_id.allowed_portal_user_ids
|
||||
elif task.project_id.privacy_visibility == 'followers_portal':
|
||||
task.allowed_user_ids |= task.project_id.allowed_internal_user_ids
|
||||
task.allowed_user_ids |= task.project_id.allowed_portal_user_ids
|
||||
|
||||
if task.project_id.privacy_visibility not in ('portal','followers_portal'):
|
||||
task.allowed_user_ids -= portal_users
|
||||
elif task.project_id.privacy_visibility not in ('followers','followers_portal'):
|
||||
task.allowed_user_ids -= internal_users
|
||||
|
||||
def _compute_access_warning(self):
|
||||
for task in self.filtered(lambda x: x.project_id.privacy_visibility not in ('portal','followers_portal')):
|
||||
task.access_warning = _(
|
||||
"The task cannot be shared with the recipient(s) because the privacy of the project is too restricted. Set the privacy of the project to 'Visible by following customers' in order to make it accessible by the recipient(s).")
|
||||
|
||||
def message_subscribe(self, partner_ids=None, channel_ids=None, subtype_ids=None):
|
||||
"""
|
||||
Add the users subscribed to allowed portal users
|
||||
"""
|
||||
res = super(Task, self).message_subscribe(partner_ids=partner_ids, channel_ids=channel_ids, subtype_ids=subtype_ids)
|
||||
if partner_ids:
|
||||
new_allowed_users = self.env['res.partner'].browse(partner_ids).user_ids.filtered('share')
|
||||
tasks = self.filtered(lambda task: task.project_id.privacy_visibility == 'followers_portal')
|
||||
tasks.sudo().allowed_user_ids |= new_allowed_users
|
||||
return res
|
||||
|
||||
|
||||
@api.model_create_multi
|
||||
def create(self, vals_list):
|
||||
@@ -71,18 +42,18 @@ class Task(models.Model):
|
||||
|
||||
group_func = lambda pdata: pdata['type'] == 'user' and project_user_group_id in pdata['groups']
|
||||
if self.project_id.privacy_visibility == 'followers_portal':
|
||||
allowed_user_ids = self.project_id.allowed_internal_user_ids.partner_id.ids
|
||||
message_partner_ids = self.project_id.message_partner_ids.partner_id.ids
|
||||
group_func = lambda pdata:\
|
||||
pdata['type'] == 'user'\
|
||||
and (
|
||||
project_manager_group_id in pdata['groups']\
|
||||
or (project_user_group_id in pdata['groups'] and pdata['id'] in allowed_user_ids)
|
||||
or (project_user_group_id in pdata['groups'] and pdata['id'] in message_partner_ids)
|
||||
)
|
||||
groups = [('group_project_user', group_func, {})]+groups
|
||||
allowed_user_ids = self.project_id.allowed_portal_user_ids.partner_id.ids
|
||||
message_partner_ids = self.project_id.message_partner_ids
|
||||
groups.insert(0, (
|
||||
'allowed_portal_users',
|
||||
lambda pdata: pdata['type'] == 'portal' and pdata['id'] in allowed_user_ids,
|
||||
'message_partner_ids',
|
||||
lambda pdata: pdata['type'] == 'portal' and pdata['id'] in message_partner_ids,
|
||||
{}
|
||||
))
|
||||
|
||||
|
@@ -8,8 +8,7 @@
|
||||
<field name="model_id" ref="model_project_project"/>
|
||||
<field name="domain_force">[
|
||||
('privacy_visibility', '=', 'followers_portal'),
|
||||
'|', ('allowed_portal_user_ids', 'in', user.ids),
|
||||
('allowed_internal_user_ids', 'in', user.ids),
|
||||
('message_partner_ids', 'in', [user.partner_id.id])
|
||||
]</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_user')),(4, ref('base.group_portal'))]"/>
|
||||
</record>
|
||||
@@ -19,36 +18,46 @@
|
||||
<field name="model_id" ref="model_project_task"/>
|
||||
<field name="domain_force">[
|
||||
('project_id.privacy_visibility', '=', 'followers_portal'),
|
||||
('allowed_user_ids', 'in', user.ids),
|
||||
'|',
|
||||
('project_id.message_partner_ids', 'child_of', [user.partner_id.commercial_partner_id.id]),
|
||||
('message_partner_ids', 'child_of', [user.partner_id.commercial_partner_id.id]),
|
||||
]</field>
|
||||
<field name="groups" eval="[(4, ref('base.group_user')),(4, ref('base.group_portal'))]"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- change existing rule -->
|
||||
<!-- extend existing rule -->
|
||||
<record model="ir.rule" id="project.project_public_members_rule">
|
||||
<field name="domain_force">[
|
||||
'|',
|
||||
('privacy_visibility', '!=', 'followers_portal'),
|
||||
('allowed_internal_user_ids', 'in', user.ids),
|
||||
('message_partner_ids', 'in', [user.partner_id.id]),
|
||||
'|',
|
||||
('privacy_visibility', '!=', 'followers'),
|
||||
('allowed_internal_user_ids', 'in', user.ids),
|
||||
('message_partner_ids', 'in', [user.partner_id.id])
|
||||
]</field>
|
||||
</record>
|
||||
|
||||
<record model="ir.rule" id="project.task_visibility_rule">
|
||||
<field name="domain_force">[
|
||||
'|',
|
||||
('project_id.privacy_visibility', '!=', 'followers_portal'),
|
||||
('allowed_user_ids', 'in', user.ids),
|
||||
'|',
|
||||
('project_id.privacy_visibility', '!=', 'followers'),
|
||||
('allowed_user_ids', 'in', user.ids),
|
||||
'&',
|
||||
('project_id', '!=', False),
|
||||
(
|
||||
'|',
|
||||
('project_id.privacy_visibility', '!=', 'followers_portal'),
|
||||
('project_id.message_partner_ids', 'in', [user.partner_id.id]),
|
||||
'|',
|
||||
('project_id.privacy_visibility', '!=', 'followers'),
|
||||
('project_id.message_partner_ids', 'in', [user.partner_id.id]),
|
||||
),
|
||||
'|',
|
||||
('message_partner_ids', 'in', [user.partner_id.id]),
|
||||
# to subscribe check access to the record, follower is not enough at creation
|
||||
('user_ids', 'in', user.id)
|
||||
]</field>
|
||||
<field name="groups" eval="[(4,ref('base.group_user'))]"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
</data>
|
||||
</odoo>
|
||||
|
@@ -1,20 +0,0 @@
|
||||
<!-- todo: remove the date_start and date_end from the Extra Info Tab -->
|
||||
<odoo>
|
||||
<data>
|
||||
|
||||
<record id="view_project_form_visibility_followers_portal" model="ir.ui.view">
|
||||
<field name="name">project.form.visibility.followers.portal</field>
|
||||
<field name="model">project.project</field>
|
||||
<field name="inherit_id" ref="project.edit_project"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='allowed_internal_user_ids']" position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('privacy_visibility', '!=', 'followers'),('privacy_visibility', '!=', 'followers_portal')]}</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//field[@name='allowed_portal_user_ids']" position="attributes">
|
||||
<attribute name="attrs">{'invisible': [('privacy_visibility', '!=', 'portal'),('privacy_visibility', '!=', 'followers_portal')]}</attribute>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</odoo>
|
Reference in New Issue
Block a user