Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[10.0][MIG] mgmtsystem_nonconformity_project
- Loading branch information
1 parent
e64c1b0
commit 6d3e8f0
Showing
10 changed files
with
160 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
.. 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 | ||
|
||
============================ | ||
Management System - Project | ||
============================ | ||
|
||
This module enables you to set a project as an action in the nonconformity. | ||
|
||
Installation | ||
============ | ||
|
||
No installation steps required. | ||
|
||
Configuration | ||
============= | ||
|
||
No configuration required. | ||
|
||
Usage | ||
===== | ||
|
||
Known issues / Roadmap | ||
====================== | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/ | ||
Management-system/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 `here <https://github.com/OCA/ | ||
Management-system/issues/new?body=module:%20 | ||
mgmtsystem_nonconformity_project%0Aversion:%20 | ||
9.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Savoir-faire Linux <support@savoirfairelinux.com> | ||
* Gervais Naoussi <gervaisnaoussi@gmail.com> | ||
* Dave Burkholder <dave@thinkwelldesigns.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 http://odoo-community.org. | ||
|
||
Changelog | ||
--------- | ||
|
||
v10.0.1.0.0 | ||
|
||
* the module does no depends anymore on document_page module. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# -*- encoding: utf-8 -*- | ||
|
||
from . import mgmtsystem_nonconformity_project | ||
# -*- coding: utf-8 -*- | ||
from . import models | ||
from .hooks import set_action_type |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,20 @@ | ||
# -*- encoding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# OpenERP, Open Source Management Solution | ||
# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). | ||
# | ||
# 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/>. | ||
# | ||
############################################################################## | ||
# -*- coding: utf-8 -*- | ||
{ | ||
"name": "Management System - Project", | ||
"version": "1.0", | ||
"version": "10.0.1.0.0", | ||
"author": "Savoir-faire Linux,Odoo Community Association (OCA)", | ||
"website": "http://www.savoirfairelinux.com", | ||
"license": "AGPL-3", | ||
"category": "Management System", | ||
"description": """\ | ||
This module enables you to set a project as an action in the nonconformity. | ||
""", | ||
"depends": [ | ||
'mgmtsystem_nonconformity', | ||
'mgmtsystem_action', | ||
'project' | ||
'project', | ||
], | ||
"data": [ | ||
'mgmtsystem_nonconformity_project.xml', | ||
'mgmtsystem_nonconformity_project_data.xml', | ||
'views/mgmtsystem_nonconformity_project.xml', | ||
], | ||
"demo": [], | ||
'installable': False, | ||
'installable': True, | ||
"post_init_hook": "set_action_type", | ||
} | ||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
|
||
def set_action_type(cr, registry): | ||
"""Initialize current data in inherited modules.""" | ||
cr.execute(""" | ||
UPDATE mgmtsystem_action SET action_type='action' | ||
WHERE action_type IS null | ||
""") |
77 changes: 0 additions & 77 deletions
77
mgmtsystem_nonconformity_project/mgmtsystem_nonconformity_project.py
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
mgmtsystem_nonconformity_project/mgmtsystem_nonconformity_project.xml
This file was deleted.
Oops, something went wrong.
10 changes: 0 additions & 10 deletions
10
mgmtsystem_nonconformity_project/mgmtsystem_nonconformity_project_data.xml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
from . import mgmtsystem_nonconformity_project |
34 changes: 34 additions & 0 deletions
34
mgmtsystem_nonconformity_project/models/mgmtsystem_nonconformity_project.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# -*- coding: utf-8 -*- | ||
from odoo import api, models, fields | ||
|
||
|
||
class MgmtsystemAction(models.Model): | ||
_inherit = "mgmtsystem.action" | ||
|
||
def _compute_complete_name(self): | ||
for action in self: | ||
action.complete_name = '%s %s' % action.name_get()[0] | ||
|
||
name = fields.Char('Claim Subject', size=128) | ||
action_type = fields.Selection([ | ||
('action', 'Action'), | ||
('project', 'Project'), | ||
], | ||
string='Action Type', | ||
required=True, | ||
default='action', | ||
) | ||
project_id = fields.Many2one('project.project', 'Project') | ||
complete_name = fields.Char('Complete Name', | ||
compute='_compute_complete_name', | ||
size=250, store=True) | ||
|
||
@api.multi | ||
def name_get(self): | ||
res = list() | ||
for o in self: | ||
r = (o.id, o.name) | ||
if o.action_type == 'project' and o.project_id: | ||
r = (o.id, o.project_id.name) | ||
res.append(r) | ||
return res |
37 changes: 37 additions & 0 deletions
37
mgmtsystem_nonconformity_project/views/mgmtsystem_nonconformity_project.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<odoo> | ||
|
||
<record id="view_mgmtsystem_action_tree" model="ir.ui.view"> | ||
<field name="name">mgmtsystem.action.tree</field> | ||
<field name="model">mgmtsystem.action</field> | ||
<field name="inherit_id" ref="mgmtsystem_action.view_mgmtsystem_action_tree"/> | ||
<field name="arch" type="xml"> | ||
|
||
<field name="name" position="replace"> | ||
<field name="action_type"/> | ||
<field name="complete_name"/> | ||
</field> | ||
|
||
</field> | ||
</record> | ||
|
||
<record id="view_mgmtsystem_action_form" model="ir.ui.view"> | ||
<field name="name">mgmtsystem.action.form</field> | ||
<field name="model">mgmtsystem.action</field> | ||
<field name="inherit_id" ref="mgmtsystem_action.view_mgmtsystem_action_form"/> | ||
<field name="arch" type="xml"> | ||
|
||
<field name="name" position="replace"> | ||
<field name="action_type"/> | ||
</field> | ||
|
||
<field name="type_action" position="after"> | ||
<field name="name" colspan="4" | ||
attrs="{'invisible' : [('action_type', '!=', 'action')]}"/> | ||
<field name="project_id" colspan="4" | ||
attrs="{'invisible' : [('action_type', '!=', 'project')]}"/> | ||
</field> | ||
|
||
</field> | ||
</record> | ||
|
||
</odoo> |