def _if_misc_tools(self, cr, uid, ids, context=None):
interface = self.pool.get('res.users').browse(cr, uid, uid, context=context).view
if interface == 'simple' or interface =='extended' :
- return ['lunch','idea','survey']
+ return ['profile_tools']
return None
def _if_account(self, cr, uid, ids, context=None):
<field name="arch" type="xml">
<search string="Box Amount by User">
<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'))]"
- help="Box amount in last 365 days"/>
- <filter icon="terp-go-month" string=" 30 Days "
+ <filter icon="terp-go-year" string=" Year "
+ domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-01-01'))]"
+ help="Box amount in current year"/>
+ <filter icon="terp-go-month" string=" Month "
name="month"
- domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=30)).strftime('%%Y-%%m-%%d'))]"
- help="Box amount in last 30 days"/>
- <filter icon="terp-go-week"
- string=" 7 Days "
+ domain="[('date','<=', time.strftime('%%Y-%%m-%%d')),('date','>=',time.strftime('%%Y-%%m-01'))]"
+ help="Box amount in current month"/>
+ <filter icon="terp-go-week"
+ string=" Month-1 "
separator="1"
- domain="[('date','<=', time.strftime('%%Y-%%m-%%d')), ('date','>',(datetime.date.today()-datetime.timedelta(days=7)).strftime('%%Y-%%m-%%d'))]"
- help="Box amount in last 7 days"/>
+ 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="Box amount in last month"/>
<separator orientation="vertical"/>
<field name="user_id" select="1"/>
<field name="box" select="1"/>