Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] project_categ_issue: Migrated to 10.0 #229

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
49 changes: 49 additions & 0 deletions project_categ_issue/README.rst
@@ -0,0 +1,49 @@
.. 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 Category Issue
======================

* Adds to Issues the ability to limit selectable Categories to a Project's specific list.

Usage
=====

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/140/10.0

Known issues / Roadmap
======================

*

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



Credits
=======

Contributors
------------
* Daniel Reis
* Rigoberto Martínez <rigo1985@gmail.com>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

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.

To contribute to this module, please visit https://odoo-community.org.
6 changes: 5 additions & 1 deletion project_categ_issue/__init__.py
@@ -1,2 +1,6 @@
# -*- coding: utf-8 -*-
from . import project_categ_model
# (c) 2013 Daniel Reis
# (c) 2017 Rigoberto Martínez <rigo1985@gmail.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from . import models
35 changes: 9 additions & 26 deletions project_categ_issue/__manifest__.py
@@ -1,40 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 Daniel Reis
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
# © 2013 Daniel Reis
# © 2017 Rigoberto Martínez <rigo1985@gmail.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

{
'name': 'Per Project Configurable Categorie on Issues',
'summary': 'Projects Issues can have an allowed category list',
'version': '8.0.0.1.0',
'version': '10.0.0.1.0',
"category": "Project Management",
'description': """\
Adds to Issues the ability to limit selectable Categories to a Proeject's
specific list.
""",
'author': "Daniel Reis,Odoo Community Association (OCA)",
'author': "Daniel Reis, Tecnativa, Odoo Community Association (OCA)",
'website': 'https://www.tecnativa.com',
'license': 'AGPL-3',
'depends': [
'project_issue',
'project_categ',
],
'data': [
'project_categ_view.xml',
'views/project_categ_view.xml',
],
'installable': False,
'installable': True,
'auto_install': True,
}
6 changes: 6 additions & 0 deletions project_categ_issue/models/__init__.py
@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# © 2013 Daniel Reis
# © 2017 Rigoberto Martínez <rigo1985@gmail.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from . import project_categ_model
31 changes: 31 additions & 0 deletions project_categ_issue/models/project_categ_model.py
@@ -0,0 +1,31 @@
# -*- coding: utf-8 -*-
# © 2013 Daniel Reis
# © 2017 Rigoberto Martínez <rigo1985@gmail.com>
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html

from odoo import api, fields, models


class ProjectProject(models.Model):
_inherit = 'project.project'

issue_tag_id = fields.Many2one('project.tags',
string='Root Tag for Issues')


class ProjectIssue(models.Model):
_inherit = 'project.issue'

tag_project = fields.Many2one('project.tags', string='Root Tag for Issues',

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Root Tag?
(shorter)

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the original field names- it eases eases version upgrades.

compute='_compute_project_root_tag')

@api.multi
@api.depends('project_id')
def _compute_project_root_tag(self):
for issue in self:
issue.tag_project = issue.project_id.issue_tag_id or False

@api.onchange('project_id')
def _onchange_project(self):
super(ProjectIssue, self)._onchange_project_id()
self.tag_ids &= self.project_id.issue_tag_id.child_ids
59 changes: 0 additions & 59 deletions project_categ_issue/project_categ_model.py

This file was deleted.

40 changes: 0 additions & 40 deletions project_categ_issue/project_categ_view.xml

This file was deleted.

34 changes: 34 additions & 0 deletions project_categ_issue/views/project_categ_view.xml
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<!-- Project form -->
<record id="project_categ_issue_project_view_form" model="ir.ui.view">
<field name="name">project.categ.issue.project.view.form</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project"/>
<field name="arch" type="xml">
<field name="sequence" position="before">
<field name="issue_tag_id" domain="[('child_ids','!=',False)]"/>
</field>
</field>
</record>

<!-- Project Issue form -->
<record id="project_categ_issue_project_issue_view_form" model="ir.ui.view">
<field name="name">project.categ.issue.project.issue.view.form</field>
<field name="model">project.issue</field>
<field name="inherit_id" ref="project_issue.project_issue_form_view"/>
<field name="arch" type="xml">
<field name="project_id" position="replace" />
<field name="tag_ids" position="before" >
<field name="project_id" context="{'default_use_issues':1}" groups="base.group_user" />
<field name="tag_project" invisible="1"/>
</field>
<field name="tag_ids" position="attributes">
<attribute name="domain">[('id', 'child_of', tag_project),('id','!=',tag_project)]</attribute>
<attribute name="attrs">{'required':[('tag_project','!=',False)]}</attribute>
</field>
</field>
</record>

</odoo>