Merge branch 'pawan_branch' into 'development'

add tag for project

See merge request prakash.jain/cor-odoo!88
This commit is contained in:
pawan.sharma 2021-01-21 03:56:55 -08:00
commit e14772d179
3 changed files with 79 additions and 8 deletions

View File

@ -69,6 +69,7 @@ class Project(models.Model):
copy=False, help="Consultant timesheet hours")
project_cons_hrs = fields.One2many('project.consultant.hrs', 'project_id', 'Consultant Allocation', copy=False)
comment = fields.Text(string='Comment')
tag_ids = fields.Many2many('custom.project.tags', string='Tags')
# @api.onchange('allowed_internal_user_ids')
# def onchange_add_allowed_internal_users(self):
@ -286,3 +287,14 @@ class InheritProjectProductEmployeeMap(models.Model):
else:
# line.price_unit = 0
line.currency_id = False
class CustomProjectTags(models.Model):
""" Tags of project's tasks """
_name = "custom.project.tags"
_description = "Project Tag"
name = fields.Char('Name', required=True)
_sql_constraints = [
('name_uniq', 'unique (name)', "Tag name already exists!"),
]

View File

@ -7,4 +7,6 @@ access_project_consultant_hrs_pmanager,project.consultant.hrs,model_project_cons
access_model_project_multi_budget_assign_puser,project.multi.budget.assign,model_project_multi_budget_assign,project.group_project_user,1,0,0,0
access_model_project_multi_budget_assign_pmanager,project.multi.budget.assign,model_project_multi_budget_assign,project.group_project_manager,1,1,1,1
access_model_project_multi_budget_assign_line_puser,project.multi.budget.assign.line,model_project_multi_budget_assign_line,project.group_project_user,1,0,0,0
access_model_project_multi_budget_assign_line_pmanager,project.multi.budget.assign.line,model_project_multi_budget_assign_line,project.group_project_manager,1,1,1,1
access_model_project_multi_budget_assign_line_pmanager,project.multi.budget.assign.line,model_project_multi_budget_assign_line,project.group_project_manager,1,1,1,1
access_custom_project_tags_puser,custom.project.tags,model_custom_project_tags,project.group_project_user,1,1,1,1

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
7 access_model_project_multi_budget_assign_puser project.multi.budget.assign model_project_multi_budget_assign project.group_project_user 1 0 0 0
8 access_model_project_multi_budget_assign_pmanager project.multi.budget.assign model_project_multi_budget_assign project.group_project_manager 1 1 1 1
9 access_model_project_multi_budget_assign_line_puser project.multi.budget.assign.line model_project_multi_budget_assign_line project.group_project_user 1 0 0 0
10 access_model_project_multi_budget_assign_line_pmanager project.multi.budget.assign.line model_project_multi_budget_assign_line project.group_project_manager 1 1 1 1
11 access_custom_project_tags_puser custom.project.tags model_custom_project_tags project.group_project_user 1 1 1 1
12

View File

@ -21,8 +21,9 @@
<field name="date"/>
</xpath>
<xpath expr="//page[@name='settings']" position="after">
<page string="Consultant Allocation" attrs="{'invisible':['|',('pricing_type','!=','employee_rate'),('project_type','!=','hours_in_consultant')]}">
<field name="project_cons_hrs">
<page string="Consultant Allocation"
attrs="{'invisible':['|',('pricing_type','!=','employee_rate'),('project_type','!=','hours_in_consultant')]}">
<field name="project_cons_hrs">
<tree editable="top">
<field name="project_id" invisible="1"/>
<field name="employee_id" options="{'no_create_edit': True, 'no_quick_create': True}"/>
@ -33,7 +34,10 @@
<field name="actual_hours"/>
</tree>
</field>
</page>
</page>
</xpath>
<xpath expr="//field[@name='privacy_visibility']" position="before">
<field name="tag_ids" widget="many2many_tags"/>
</xpath>
</field>
</record>
@ -60,9 +64,10 @@
widget="radio"/>
<field name="project_type" attrs="{'invisible': [('pricing_type', '=', 'fixed_rate')]}"
widget="radio"/>
<field name="budgeted_revenue" attrs="{'invisible': [('pricing_type', '=', 'fixed_rate')], 'required': [('pricing_type','!=','fixed_rate')]}" />
<field name="budgeted_revenue"
attrs="{'invisible': [('pricing_type', '=', 'fixed_rate')], 'required': [('pricing_type','!=','fixed_rate')]}"/>
<field name="comment"/>
<!-- attrs="{'invisible': [('pricing_type','=','fixed_rate')], 'required': [('pricing_type','!=','fixed_rate')]}"-->
<!-- attrs="{'invisible': [('pricing_type','=','fixed_rate')], 'required': [('pricing_type','!=','fixed_rate')]}"-->
<field name="hour_distribution" widget="radio"
attrs="{'invisible': ['|',('project_type','!=','hours_in_consultant'),('pricing_type','=','fixed_rate')]}"/>
@ -107,7 +112,8 @@
domain="[('order_id','=',parent.sale_order_id), ('is_service', '=', True)]"/>
<field name="price_unit" widget="monetary" options="{'currency_field': 'currency_id'}"
attrs="{'readonly': [('parent.sale_order_id', '!=', False)]}"/>-->
<field name="price_unit" attrs="{'readonly': [('parent.project_type', '=', 'hours_no_limit')]}"/>
<field name="price_unit"
attrs="{'readonly': [('parent.project_type', '=', 'hours_no_limit')]}"/>
<field name="currency_id" invisible="1"/>
<field name="budgeted_qty"
attrs="{'readonly': [('parent.project_type', '=', 'hours_no_limit')]}"/>
@ -190,6 +196,57 @@
</field>
</record>
<!-- Tags -->
<record model="ir.ui.view" id="custom_project_tags_search_view">
<field name="name">Tags</field>
<field name="model">custom.project.tags</field>
<field name="arch" type="xml">
<search string="Tags">
<field name="name"/>
</search>
</field>
</record>
<record model="ir.ui.view" id="custom_project_tags_form_view">
<field name="name">Tags</field>
<field name="model">custom.project.tags</field>
<field name="arch" type="xml">
<form string="Tags">
<sheet>
<group>
<field name="name"/>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="custom_project_tags_tree_view">
<field name="name">Tags</field>
<field name="model">custom.project.tags</field>
<field name="arch" type="xml">
<tree string="Tags" editable="bottom" sample="1">
<field name="name"/>
</tree>
</field>
</record>
<record id="custom_project_tags_action" model="ir.actions.act_window">
<field name="name">Project Tags</field>
<field name="res_model">custom.project.tags</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
No tags found. Let's create one!
</p>
<p>
Tags are perfect to categorize your tasks.
</p>
</field>
</record>
<menuitem action="custom_project_tags_action" id="menu_custom_project_tags_act"
parent="project.menu_project_config" sequence="9"/>
<menuitem name="Tasks" id="menu_main_cor_tasks"
action="project.action_view_all_task" sequence="52" groups="base.group_no_one,project.group_project_user"/>
action="project.action_view_all_task" sequence="52"
groups="base.group_no_one,project.group_project_user"/>
</odoo>