mirror of
https://github.com/OCA/pms.git
synced 2025-01-29 00:17:45 +02:00
[IMP] pms_project: Add property on project (#156)
This commit is contained in:
committed by
GitHub
parent
3ed3080749
commit
b5458c184f
@@ -9,7 +9,11 @@
|
||||
"depends": ["pms_base", "project"],
|
||||
"author": "Open Source Integrators, Odoo Community Association (OCA)",
|
||||
"website": "https://github.com/OCA/pms",
|
||||
"data": ["views/pms_property_views.xml", "views/project_task_views.xml"],
|
||||
"data": [
|
||||
"views/pms_property_views.xml",
|
||||
"views/project_task_views.xml",
|
||||
"views/project.xml",
|
||||
],
|
||||
"maintainers": ["max3903"],
|
||||
"development_status": "Beta",
|
||||
}
|
||||
|
||||
@@ -2,3 +2,4 @@
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from . import project_task
|
||||
from . import pms_property
|
||||
from . import project
|
||||
|
||||
9
pms_project/models/project.py
Normal file
9
pms_project/models/project.py
Normal file
@@ -0,0 +1,9 @@
|
||||
# Copyright (C) 2022 Casai (https://www.casai.com)
|
||||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class Project(models.Model):
|
||||
_inherit = "project.project"
|
||||
|
||||
property_id = fields.Many2one("pms.property", string="Property")
|
||||
27
pms_project/views/project.xml
Normal file
27
pms_project/views/project.xml
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<odoo>
|
||||
<data>
|
||||
<record id="project_form_view_custom" model="ir.ui.view">
|
||||
<field name="name">Project form view custom</field>
|
||||
<field name="model">project.project</field>
|
||||
<field name="inherit_id" ref="project.edit_project" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//notebook" position="before">
|
||||
<field name="property_id" placeholder="Property" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
<!-- view search -->
|
||||
<record id="search_view_property" model="ir.ui.view">
|
||||
<field name="name">Property search</field>
|
||||
<field name="model">project.project</field>
|
||||
<field name="inherit_id" ref="project.view_project_project_filter" />
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//filter[@name='my_projects']" position="after">
|
||||
<separator />
|
||||
<field name="property_id" />
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
</data>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user