add sub-project feater

This commit is contained in:
Pawan Kumar 2020-12-09 18:35:10 +05:30
parent 19970ef7d3
commit d0291482ab
8 changed files with 53 additions and 0 deletions

1
sub_project/__init__.py Normal file
View File

@ -0,0 +1 @@
from . import models

View File

@ -0,0 +1,16 @@
{
'name': 'sub_project',
'version': '',
'summary': 'Sub Project of sub project',
'description': 'Sub Project of sub project',
'category': '',
'author': '',
'website': '',
'license': '',
'depends': ['base', 'project'],
'data': ['views/sub_project.xml'],
'demo': [''],
'installable': True,
'auto_install': False,
}

Binary file not shown.

View File

@ -0,0 +1 @@
from . import sub_project

Binary file not shown.

View File

@ -0,0 +1,9 @@
from odoo import api, fields, models
class SubProject(models.Model):
_inherit = "project.project"
_description = "Sub Project"
is_sub_project = fields.Boolean("Is Sub Project")
parent_project = fields.Many2one('project.project', string='Parent Project')

View File

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record id="edit_project_inherited" model="ir.ui.view">
<field name="name">project.project.form.inherit</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.edit_project"/>
<field name="arch" type="xml">
<data>
<xpath expr="//page[@name='settings']" position="after">
<page name="sub_project" string="Sub Project">
<group>
<field name="is_sub_project"/>
</group>
<group>
<field name="parent_project"
options="{'no_open': True, 'no_create': True, 'no_create_edit': True}"/>
</group>
</page>
</xpath>
</data>
</field>
</record>
</data>
</odoo>