[REM] project: Remove the project.message object ,

[ADD] project_message: Add the action related to project

bzr revid: sbh@tinyerp.com-20100826105642-i8938zr08bwahgw6
This commit is contained in:
sbh (Open ERP) 2010-08-26 16:26:42 +05:30
parent 93f158e974
commit b8e2e2139d
8 changed files with 29 additions and 118 deletions

View File

@ -79,15 +79,7 @@
<field name="domain">[('type','=','Project')]</field>
</record>
<!--Actions for deshboard -->
<record id="action_view_project_editable_messages_tree" model="ir.actions.act_window">
<field name="name">Messages</field>
<field name="res_model">project.message</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="project.view_project_message_tree"/>
</record>
<record id="board_project_form" model="ir.ui.view">
<field name="name">board.project.form</field>

View File

@ -792,32 +792,7 @@ class config_compute_remaining(osv.osv_memory):
config_compute_remaining()
class message(osv.osv):
_name = "project.message"
_description = "Message"
_columns = {
'subject': fields.char('Subject', size=128, required="True"),
'project_id': fields.many2one('project.project', 'Project', ondelete='cascade'),
'date': fields.date('Date', required=1),
'user_id': fields.many2one('res.users', 'User', required="True"),
'description': fields.text('Description'),
}
def _default_project(self, cr, uid, context=None):
if context is None:
context = {}
if 'project_id' in context and context['project_id']:
return int(context['project_id'])
return False
_defaults = {
'user_id': lambda self,cr,uid,ctx: uid,
'date': time.strftime('%Y-%m-%d'),
'project_id': _default_project
}
message()
class account_analytic_account(osv.osv):
_inherit = 'account.analytic.account'

View File

@ -254,15 +254,7 @@
<field name="project_id" ref="project_project_22"/>
<field name="name">Latest in house tests</field>
</record>
<record id="project_message_1" model="project.message">
<field name="project_id" ref="project.project_project_23"/>
<field name="user_id" ref="base.user_root"/>
<field name="description">Follow the procedure of Configuration wizard.
- Add all required modules
- Add chat of accounts
- Create Users</field>
<field name="subject">Configuration steps</field>
</record>
</data>
</openerp>

View File

@ -566,81 +566,10 @@ Issues like bugs in a system, client complain, materials breakdown are collected
</field>
</record>
<!--- Messages-->
<record id="view_project_message_form" model="ir.ui.view">
<field name="name">project.message.form</field>
<field name="model">project.message</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Messages">
<group colspan="6">
<field name="subject" select="1"/>
<field name="project_id"/>
<field name="user_id" select="1"/>
<field name="date"/>
</group>
<separator string="Description" colspan="4"/>
<field name="description" nolabel="1" colspan="4"/>
</form>
</field>
</record>
<record id="view_project_message_tree" model="ir.ui.view">
<field name="name">project.message.tree</field>
<field name="model">project.message</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Messages">
<field name="date" select="1"/>
<field name="subject" select="1"/>
<field name="project_id" select="1"/>
<field name="user_id" select="1"/>
</tree>
</field>
</record>
<record id="view_project_message_search" model="ir.ui.view">
<field name="name">project.message.search</field>
<field name="model">project.message</field>
<field name="type">search</field>
<field name="arch" type="xml">
<search string="Messages">
<group col="20" colspan="4">
<filter domain="[('date','&gt;=',time.strftime('%%Y-%%m-01'))]" icon="terp-go-month" string="This Month" />
<filter domain="[('date', '=', time.strftime('%%Y-%%m-%%d'))]" icon="terp-go-today" string="Today" />
<separator orientation="vertical"/>
<field name="subject"/>
<field name="project_id" select="1"/>
<field name="user_id" select="1"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="20">
<filter string="Project" icon="terp-folder-blue" domain="[]" context="{'group_by':'project_id'}"/>
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date'}"/>
</group>
</search>
</field>
</record>
<record id="action_view_project_messages_tree" model="ir.actions.act_window">
<field name="name">Project Messages</field>
<field name="res_model">project.message</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_project_message_tree"/>
<field name="context">{"search_default_project_id":project_id, "search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_project_message_search"/>
<field name="help">An in-project messagery system permits an efficient and trackable communication between project members. The messages are kept in the system and can then be used for post-analysis.</field>
</record>
<menuitem action="action_view_project_messages_tree" id="menu_message_tree" parent="menu_project_management" sequence="11"/>
<act_window domain="[('user_id', '=', active_id),('state', '&lt;&gt;', 'cancelled'),('state', '&lt;&gt;', 'done')]" id="act_res_users_2_project_task_opened" name="Assigned tasks" res_model="project.task" src_model="res.users" view_mode="tree,form,gantt,calendar,graph" view_type="form"/>
<act_window domain="[('user_id', '=', active_id),('date', '&gt;=', time.strftime('%Y-%m-01'))]" id="act_res_users_2_project_task_work_month" name="Month works" res_model="project.task.work" src_model="res.users" view_mode="tree,form" view_type="form"/>
<act_window domain="[('project_id', '=', active_id)]" id="act_project_messages" name="Messages" res_model="project.message" src_model="project.project"/>
</data>
</openerp>

View File

@ -9,7 +9,6 @@
"access_project_task","project.task","model_project_task","project.group_project_user",1,1,1,1
"access_project_task_work","project.task.work","model_project_task_work","project.group_project_user",1,1,1,1
"access_project_task_work_manager","project.task.work.manager","model_project_task_work","project.group_project_manager",1,1,1,1
"access_project_message","project.message","model_project_message","project.group_project_user",1,1,1,1
"access_report_project_task_user","report.project.task.user","model_report_project_task_user","project.group_project_manager",1,1,1,1
"access_project_vs_hours","project.vs.hours","model_project_vs_hours","project.group_project_user",1,1,1,1
"access_task_by_days","task.by.days","model_task_by_days","project.group_project_user",1,1,1,1
@ -19,8 +18,6 @@
"access_partner_address_task manager","base.res.partner.address manager","base.model_res_partner_address","project.group_project_manager",1,0,0,0
"access_task_on_partner","project.task on partners","model_project_task","base.group_user",1,0,0,0
"access_project_on_partner","project.project on partners","model_project_project","base.group_user",1,0,0,0
"access_project_message_manager","project.message manager","model_project_message","project.group_project_manager",1,0,0,0
"access_project_message_system","project.message system","model_project_message","base.group_system",1,0,0,0
"access_project_task_system","project.task system","model_project_task","base.group_system",1,0,0,0
"access_project_project_system","project.project system","model_project_project","base.group_system",1,1,1,1
"access_project_task_work_system","project.task.work system","model_project_task_work","base.group_system",1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
9 access_project_task project.task model_project_task project.group_project_user 1 1 1 1
10 access_project_task_work project.task.work model_project_task_work project.group_project_user 1 1 1 1
11 access_project_task_work_manager project.task.work.manager model_project_task_work project.group_project_manager 1 1 1 1
access_project_message project.message model_project_message project.group_project_user 1 1 1 1
12 access_report_project_task_user report.project.task.user model_report_project_task_user project.group_project_manager 1 1 1 1
13 access_project_vs_hours project.vs.hours model_project_vs_hours project.group_project_user 1 1 1 1
14 access_task_by_days task.by.days model_task_by_days project.group_project_user 1 1 1 1
18 access_partner_address_task manager base.res.partner.address manager base.model_res_partner_address project.group_project_manager 1 0 0 0
19 access_task_on_partner project.task on partners model_project_task base.group_user 1 0 0 0
20 access_project_on_partner project.project on partners model_project_project base.group_user 1 0 0 0
access_project_message_manager project.message manager model_project_message project.group_project_manager 1 0 0 0
access_project_message_system project.message system model_project_message base.group_system 1 0 0 0
21 access_project_task_system project.task system model_project_task base.group_system 1 0 0 0
22 access_project_project_system project.project system model_project_project base.group_system 1 1 1 1
23 access_project_task_work_system project.task.work system model_project_task_work base.group_system 1 0 0 0

View File

@ -33,7 +33,7 @@
'website': 'http://www.openerp.com',
'init_xml': [],
'update_xml': ['project_messages_view.xml'],
'demo_xml': [],
'demo_xml': ['project_message_data.xml'],
'installable': True,
'active': False,
}

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="project_message_1" model="project.message">
<field name="project_id" ref="project.project_project_23"/>
<field name="user_id" ref="base.user_root"/>
<field name="description">Follow the procedure of Configuration wizard.
- Add all required modules
- Add chat of accounts
- Create Users</field>
<field name="subject">Configuration steps</field>
</record>
</data>
</openerp>

View File

@ -90,8 +90,20 @@
<field name="search_view_id" ref="view_project_messages_search"/>
<field name="context">{"search_default_to_id":uid}</field>
<field name="view_id" ref="view_project_message_tree"/>
<field name="help">An in-project messagery system permits an efficient and trackable communication between project members. The messages are kept in the system and can then be used for post-analysis.</field>
</record>
<act_window domain="[('project_id', '=', active_id)]" id="act_project_messages" name="Messages" res_model="project.messages" src_model="project.project"/>
<!--Actions for deshboard -->
<record id="action_view_project_editable_messages_tree" model="ir.actions.act_window">
<field name="name">Messages</field>
<field name="res_model">project.messages</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="project_messages.view_project_message_tree"/>
</record>
<menuitem action="messages_form" id="menu_messages_form" parent="project.menu_project_management"/>
</data>
</openerp>