Skip to content

Commit

Permalink
[Add] Construction project site address
Browse files Browse the repository at this point in the history
  • Loading branch information
mathi123 committed May 25, 2015
1 parent b267680 commit b1f60ea
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 0 deletions.
30 changes: 30 additions & 0 deletions project_construction_site/README.rst
@@ -0,0 +1,30 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:alt: License: AGPL-3

Construction Site Address
============================

This module allows you to assign a construction site to a project.

Credits
=======

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

* Mathias Colpaert <colpaert.mathias@gmail.com>

Maintainer
----------

.. image:: http://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: http://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.
2 changes: 2 additions & 0 deletions project_construction_site/__init__.py
@@ -0,0 +1,2 @@
# -*- coding: utf-8 -*-
from . import models
28 changes: 28 additions & 0 deletions project_construction_site/__openerp__.py
@@ -0,0 +1,28 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# Author: Mathias Colpaert
#
# 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/>.
#
##############################################################################
{
'name': "OCA Construction: Project site address.",
'summary': """Construction site address of a project.""",
'author': "Mathias Colpaert, Odoo Community Association (OCA)",
'category': "construction",
'version': '0.1',
'depends': ['crm'],
'data': ['views.xml'],
}
12 changes: 12 additions & 0 deletions project_construction_site/i18n/nl_BE.po
@@ -0,0 +1,12 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * project_construction_site
#
msgid ""
msgstr ""

#. module: project_construction_site
#: field:project.project,site:0
msgid "Site"
msgstr "Werf Adres"

17 changes: 17 additions & 0 deletions project_construction_site/models.py
@@ -0,0 +1,17 @@
# -*- coding: utf-8 -*-

from openerp import models, fields, api


class Project(models.Model):
_name = 'project.project'
_inherit = 'project.project'

site = fields.Many2one('res.partner')

@api.multi
def onchange_partner_id(self, partner_id):
res = super(Project, self).onchange_partner_id(partner_id)
if partner_id:
res['value'].update({'site': partner_id})
return res
1 change: 1 addition & 0 deletions project_construction_site/oca_dependencies.txt
@@ -0,0 +1 @@
# List the OCA project dependencies, one per line
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions project_construction_site/static/description/index.html
@@ -0,0 +1,31 @@
<section class="oe_container">
<div class="oe_row oe_spaced">
<div class="oe_span12">
<h2 class="oe_slogan">Construction Site in CRM</h2>
<p>This module allows you to assign a construction site to a lead or opportunity.</p>
</div>
</div>
</section>

<section class="oe_container oe_dark">
<div class="oe_row">
<div class="oe_span12">
<h2 class="oe_slogan">Credits</h2>
</div>
<div class="oe_span12">
<h3>Contributors</h3>
<ul>
<li>Mathias Colpaert &lt;<a href="mailto:colpaert.mathias@gmail.com">colpaert.mathias@gmail.com</a>&gt;</li>
</ul>
</div>
<div class="oe_span12">
<h3>Maintainer</h3>
<p>
This module is maintained by the OCA.<br/>
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.<br/>
To contribute to this module, please visit <a href="http://odoo-community.org">http://odoo-community.org</a>.<br/>
<a href="http://odoo-community.org"><img class="oe_picture oe_centered" src="http://odoo-community.org/logo.png"></a>
</p>
</div>
</div>
</section>
17 changes: 17 additions & 0 deletions project_construction_site/views.xml
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Project form view -->
<record model="ir.ui.view" id="construction_site_project_form">
<field name="name">construction.site.project.form</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project" />
<field name="arch" type="xml">
<xpath expr="//field[@name='date_start']" position="before">
<field name="site"/>
</xpath>
</field>
</record>

</data>
</openerp>

0 comments on commit b1f60ea

Please sign in to comment.