Skip to content

Commit

Permalink
[10.0][MIG] mgmtsystem_nonconformity_project
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkwelltwd committed Jul 4, 2017
1 parent e64c1b0 commit 6d3e8f0
Show file tree
Hide file tree
Showing 10 changed files with 160 additions and 158 deletions.
69 changes: 69 additions & 0 deletions mgmtsystem_nonconformity_project/README.rst
@@ -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.
6 changes: 3 additions & 3 deletions mgmtsystem_nonconformity_project/__init__.py
@@ -1,3 +1,3 @@
# -*- encoding: utf-8 -*-

from . import mgmtsystem_nonconformity_project
# -*- coding: utf-8 -*-
from . import models
from .hooks import set_action_type
35 changes: 6 additions & 29 deletions mgmtsystem_nonconformity_project/__manifest__.py
@@ -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:
9 changes: 9 additions & 0 deletions mgmtsystem_nonconformity_project/hooks.py
@@ -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
""")

This file was deleted.

This file was deleted.

This file was deleted.

2 changes: 2 additions & 0 deletions mgmtsystem_nonconformity_project/models/__init__.py
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import mgmtsystem_nonconformity_project
@@ -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
@@ -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>

0 comments on commit 6d3e8f0

Please sign in to comment.