Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
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
104 changes: 104 additions & 0 deletions project_template_milestone/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

============================
Project Template & Milestone
============================

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

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

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

This module adds the function to copy milestones when creating projects
from templates.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

1. If milestones are used on the template, then the milestones will also
be copied when creating a project from the template.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/project/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/project/issues/new?body=module:%20project_template_milestone%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
-------

* Patrick Wilson
* Open Source Integrators

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

- Patrick Wilson <[email protected]>
- Open Source Integrators
- Serpent Consulting Services Pvt. Ltd. <[email protected]>
- Le Dinh Tien <[email protected]>
- `Komit <https://komit-consulting.com>`__:

- Vang Nguyen Phu

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-patrickrwilson| image:: https://github.com/patrickrwilson.png?size=40px
:target: https://github.com/patrickrwilson
:alt: patrickrwilson

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

|maintainer-patrickrwilson|

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

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions project_template_milestone/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
18 changes: 18 additions & 0 deletions project_template_milestone/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Project Template & Milestone",
"summary": """Adds function to copy of milestones when creating
a project from template""",
"author": "Patrick Wilson, Odoo Community Association (OCA),"
"Open Source Integrators",
"website": "https://github.com/OCA/project",
"category": "Project Management",
"version": "19.0.1.0.0",
"license": "AGPL-3",
"depends": ["project_template"],
"application": False,
"auto_install": True,
"development_status": "Beta",
"maintainers": ["patrickrwilson"],
}
22 changes: 22 additions & 0 deletions project_template_milestone/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_template_milestone
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2019-07-09 13:43+0000\n"
"Last-Translator: Maria Sparenberg <[email protected]>\n"
"Language-Team: none\n"
"Language: de\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 3.7.1\n"

#. module: project_template_milestone
#: model:ir.model,name:project_template_milestone.model_project_project
msgid "Project"
msgstr "Projekt"
25 changes: 25 additions & 0 deletions project_template_milestone/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_template_milestone
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-05-31 10:09+0000\n"
"Last-Translator: Sergio Zanchetta <[email protected]>\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 3.10\n"

#. module: project_template_milestone
#: model:ir.model,name:project_template_milestone.model_project_project
msgid "Project"
msgstr ""

#~ msgid "WBS element"
#~ msgstr "Elemento WBS"
19 changes: 19 additions & 0 deletions project_template_milestone/i18n/project_template_milestone.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_template_milestone
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 15.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: project_template_milestone
#: model:ir.model,name:project_template_milestone.model_project_project
msgid "Project"
msgstr ""
25 changes: 25 additions & 0 deletions project_template_milestone/i18n/pt.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_template_milestone
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-01-10 13:13+0000\n"
"Last-Translator: Pedro Castro Silva <[email protected]>\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 3.10\n"

#. module: project_template_milestone
#: model:ir.model,name:project_template_milestone.model_project_project
msgid "Project"
msgstr ""

#~ msgid "WBS element"
#~ msgstr "Elemento WBS"
20 changes: 20 additions & 0 deletions project_template_milestone/i18n/pt_BR.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_template_milestone
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\n"
"Language-Team: none\n"
"Language: pt_BR\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"

#. module: project_template_milestone
#: model:ir.model,name:project_template_milestone.model_project_project
msgid "Project"
msgstr ""
26 changes: 26 additions & 0 deletions project_template_milestone/i18n/sl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_template_milestone
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 14.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2020-03-31 10:14+0000\n"
"Last-Translator: Matjaz Mozetic <[email protected]>\n"
"Language-Team: none\n"
"Language: sl\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=4; plural=n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n"
"%100==4 ? 2 : 3;\n"
"X-Generator: Weblate 3.10\n"

#. module: project_template_milestone
#: model:ir.model,name:project_template_milestone.model_project_project
msgid "Project"
msgstr ""

#~ msgid "WBS element"
#~ msgstr "Projektni člen"
3 changes: 3 additions & 0 deletions project_template_milestone/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import project
23 changes: 23 additions & 0 deletions project_template_milestone/models/project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2019 Patrick Wilson <[email protected]>
# Copyright (C) 2021 Open Source Integrators
# Copyright (C) 2021 Serpent Consulting Services
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import models


class ProjectTemplate(models.Model):
_inherit = "project.project"

def create_project_from_template(self):
self.ensure_one()
res = super().create_project_from_template()
project = self.browse(res["res_id"])
for milestone in self.milestone_ids:
milestone.copy(default={"project_id": project.id})
# LINK THE NEWLY CREATED TASKS TO THE NEWLY CREATED MILESTONES
for new_task_record in project.task_ids:
for new_milestone_record in project.milestone_ids:
if new_task_record.milestone_id.name == new_milestone_record.name:
new_task_record.milestone_id = new_milestone_record.id
return res
3 changes: 3 additions & 0 deletions project_template_milestone/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
6 changes: 6 additions & 0 deletions project_template_milestone/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- Patrick Wilson \<[email protected]\>
- Open Source Integrators
- Serpent Consulting Services Pvt. Ltd. \<[email protected]\>
- Le Dinh Tien \<tien-<[email protected]>\>
- [Komit](https://komit-consulting.com):
- Vang Nguyen Phu
2 changes: 2 additions & 0 deletions project_template_milestone/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module adds the function to copy milestones when creating projects
from templates.
4 changes: 4 additions & 0 deletions project_template_milestone/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
To use this module, you need to:

1. If milestones are used on the template, then the milestones will
also be copied when creating a project from the template.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading