[MOD/IMP] Idea : Usability Improvements. hr : department set in simplified view
bzr revid: vir@tinyerp.com-20100906112027-i1khvcoa616fwg0x
This commit is contained in:
parent
1e32fa1bb9
commit
27d6500225
|
@ -76,7 +76,7 @@
|
|||
</record>
|
||||
|
||||
<menuitem action="open_module_tree_department" id="menu_department_def" parent="hr.menu_department_tree"/>
|
||||
<menuitem action="open_module_tree_department" id="menu_hr_department_tree" parent="hr.menu_hr_management" sequence="6" groups="base.group_extended"/>
|
||||
<menuitem action="open_module_tree_department" id="menu_hr_department_tree" parent="hr.menu_hr_management" sequence="6"/>
|
||||
|
||||
<record model="ir.ui.view" id="view_users_form_inherit">
|
||||
<field name="name">res.users.form</field>
|
||||
|
|
|
@ -157,6 +157,7 @@ class idea_idea(osv.osv):
|
|||
'description': fields.text('Description', help='Content of the idea', readonly=True, states={'draft':[('readonly',False)]}),
|
||||
'comment_ids': fields.one2many('idea.comment', 'idea_id', 'Comments'),
|
||||
'created_date': fields.datetime('Creation date', readonly=True),
|
||||
'open_date': fields.datetime('Open date', readonly=True, help="Date when an idea opened"),
|
||||
'vote_ids': fields.one2many('idea.vote', 'idea_id', 'Vote'),
|
||||
'my_vote': fields.function(_vote_read, fnct_inv = _vote_save, string="My Vote", method=True, type="selection", selection=VoteValues),
|
||||
'vote_avg': fields.function(_vote_avg_compute, method=True, string="Average Score", type="float"),
|
||||
|
@ -260,7 +261,7 @@ class idea_idea(osv.osv):
|
|||
return True
|
||||
|
||||
def idea_open(self, cr, uid, ids):
|
||||
self.write(cr, uid, ids, { 'state': 'open' })
|
||||
self.write(cr, uid, ids, { 'state': 'open' ,'open_date': time.strftime('%Y-%m-%d %H:%M:%S')})
|
||||
return True
|
||||
|
||||
def idea_close(self, cr, uid, ids):
|
||||
|
|
|
@ -197,6 +197,7 @@
|
|||
<group col="6" colspan="4">
|
||||
<field name="name" select="1" />
|
||||
<field name="category_id" select="1"/>
|
||||
<field name="open_date" select="1"/>
|
||||
<field name="user_id" attrs="{'invisible':[('visibility','=',False)]}"/>
|
||||
<field name="vote_avg" widget="progressbar"/>
|
||||
<group col="4" colspan="2">
|
||||
|
@ -265,11 +266,12 @@
|
|||
<field name="arch" type="xml">
|
||||
<tree colors="blue:state in ('draft');black:state in ('open','close');gray:state in('cancel')" string="Ideas">
|
||||
<field name="name"/>
|
||||
<field name="category_id" />
|
||||
<field name="category_id"/>
|
||||
<field name="user_id"/>
|
||||
<field name="created_date"/>
|
||||
<field name="vote_avg" widget="progressbar"/>
|
||||
<field name="count_comments" />
|
||||
<field name="count_votes" />
|
||||
<field name="count_comments"/>
|
||||
<field name="count_votes"/>
|
||||
<field name="state"/>
|
||||
<button name="idea_open" string="Open" states="draft" icon="terp-gtk-go-back-rtl"/>
|
||||
<button name="%(idea.action_idea_post_vote)d" icon="gtk-execute" type="action" states="open" string="Submit Vote"/>
|
||||
|
@ -299,8 +301,9 @@
|
|||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="12" col="10">
|
||||
<filter icon="terp-personal" string="Creator" help="By Creators" context="{'group_by':'user_id'}"/>
|
||||
<filter icon="terp-stock_effects-object-colorize" string="State" help="By States" context="{'group_by':'state'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-stock_symbol-selection" string="Category" help="By Idea Category" context="{'group_by':'category_id'}"/>
|
||||
<filter icon="terp-stock_effects-object-colorize" string="State" help="By States" context="{'group_by':'state'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
|
|
@ -50,23 +50,11 @@
|
|||
<field name="signal">idea_close</field>
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t3">
|
||||
<field name="act_from" ref="act_draft" />
|
||||
<field name="act_to" ref="act_cancel" />
|
||||
<field name="signal">idea_cancel</field>
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t4">
|
||||
<field name="act_from" ref="act_open" />
|
||||
<field name="act_to" ref="act_cancel" />
|
||||
<field name="signal">idea_cancel</field>
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="t5">
|
||||
<field name="act_from" ref="act_cancel" />
|
||||
<field name="act_to" ref="act_draft" />
|
||||
<field name="signal">idea_draft</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -54,10 +54,10 @@ class report_vote(osv.osv):
|
|||
select
|
||||
min(iv.id) as id,
|
||||
count(*) as nbr,
|
||||
to_date(to_char(iv.date, 'dd-MM-YYYY'),'dd-MM-YYYY') as date,
|
||||
to_char(iv.date, 'YYYY') as year,
|
||||
to_char(iv.date, 'MM') as month,
|
||||
to_char(iv.date, 'YYYY-MM-DD') as day,
|
||||
to_date(to_char(ii.open_date, 'dd-MM-YYYY'),'dd-MM-YYYY') as date,
|
||||
to_char(ii.open_date, 'YYYY') as year,
|
||||
to_char(ii.open_date, 'MM') as month,
|
||||
to_char(ii.open_date, 'YYYY-MM-DD') as day,
|
||||
iv.user_id as user_id,
|
||||
iv.idea_id as idea_id,
|
||||
ii.state as idea_state,
|
||||
|
@ -68,8 +68,8 @@ class report_vote(osv.osv):
|
|||
idea_vote as iv
|
||||
left join idea_idea as ii on (ii.id = iv.idea_id)
|
||||
group by
|
||||
iv.id ,to_char(iv.date, 'dd-MM-YYYY'),to_char(iv.date, 'YYYY'),
|
||||
to_char(iv.date, 'MM'),to_char(iv.date, 'YYYY-MM-DD'),ii.state,
|
||||
iv.id ,to_char(ii.open_date, 'dd-MM-YYYY'),to_char(ii.open_date, 'YYYY'),
|
||||
to_char(ii.open_date, 'MM'),to_char(ii.open_date, 'YYYY-MM-DD'),ii.state,
|
||||
iv.user_id,ii.user_id,ii.category_id,iv.idea_id
|
||||
)
|
||||
""")
|
||||
|
|
|
@ -29,16 +29,16 @@
|
|||
<field name="arch" type="xml">
|
||||
<search string="Idea Vote Analysis">
|
||||
<group>
|
||||
<filter icon="terp-go-year" string=" 365 Days "
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>',(datetime.date.today()-datetime.timedelta(days=365)).strftime('%%Y-%%m-%%d'))]"
|
||||
<filter icon="terp-go-year" string=" Year "
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-01-01'))]"
|
||||
help="Idea Vote created last 365 days"/>
|
||||
<filter icon="terp-go-month" string=" 30 Days "
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
|
||||
<filter icon="terp-go-month" string=" Month "
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-%%m-01'))]"
|
||||
help="Idea Vote created in last 30 days"/>
|
||||
<filter icon="terp-go-week"
|
||||
string=" 7 Days "
|
||||
<filter icon="terp-go-month"
|
||||
string=" Month-1 "
|
||||
separator="1"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
|
||||
domain="[('date','<=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','>',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
|
||||
help="Idea Vote created last 7 days"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-go-today"
|
||||
|
@ -60,15 +60,15 @@
|
|||
domain="[('idea_state','=',('cancel'))]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="idea_id" string="Idea"/>
|
||||
<field name="creater_id" string="Creater"/>
|
||||
<field name="creater_id" string="creater"/>
|
||||
<field name="user_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="10" col="12">
|
||||
<filter string="Creater" icon="terp-personal" context="{'group_by':'creater_id'}"/>
|
||||
<filter string="creater" icon="terp-personal" context="{'group_by':'creater_id'}"/>
|
||||
<filter string="User" icon="terp-personal" name="User" context="{'group_by':'user_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Idea" icon="terp-personal" context="{'group_by':'idea_id'}"/>
|
||||
<filter string="Idea" icon="terp-idea" context="{'group_by':'idea_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Category" icon="terp-stock_symbol-selection" context="{'group_by':'category_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
|
|
@ -371,7 +371,7 @@
|
|||
name="month"
|
||||
domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-%%m-01'))]"
|
||||
help="Box amount in current month"/>
|
||||
<filter icon="terp-go-week"
|
||||
<filter icon="terp-go-month"
|
||||
string=" Month-1 "
|
||||
separator="1"
|
||||
domain="[('date','<=', (datetime.date (int(time.strftime('%%Y')), datetime.date.today().month, 1) - datetime.timedelta (days = 1)).strftime('%%Y-%%m-%%d')),('date','>',(datetime.date (int(time.strftime('%%Y')), datetime.date.today().month-1, 1)).strftime('%%Y-%%m-%%d'))]"
|
||||
|
|
Loading…
Reference in New Issue