[MERGE] Merge psi branch account: fix company_id error

hr_contract: Added Group By... Contract type in place of Department
hr_timesheet: clean and improve search view(added default user_id)
hr_timesheet_sheet: clean and improve search view(added default user_id)
hr_timesheet_invoice: improve search view(added default user_id)
project: improve search view(added default user_id)

bzr revid: mra@tinyerp.com-20100519133737-j1ycwgzizbv4f4j5
This commit is contained in:
mra (Open ERP) 2010-05-19 19:07:37 +05:30
commit e36fb2209f
9 changed files with 120 additions and 114 deletions

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
##############################################################################
#
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
@ -42,23 +42,23 @@ class account_analytic_line(osv.osv):
}
_defaults = {
'date': lambda *a: time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', c),
'company_id': lambda self,cr,uid,context: self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=context),
}
_order = 'date'
def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
if context is None:
context = {}
if context.get('from_date',False):
args.append(['date', '>=',context['from_date']])
if context.get('to_date',False):
args.append(['date','<=',context['to_date']])
return super(account_analytic_line, self).search(cr, uid, args, offset, limit,
order, context=context, count=count)
def _check_company(self, cr, uid, ids):
lines = self.browse(cr, uid, ids)
for l in lines:
@ -68,7 +68,7 @@ class account_analytic_line(osv.osv):
_constraints = [
# (_check_company, 'You can not create analytic line that is not in the same company than the account line', ['account_id'])
]
# Compute the cost based on the price type define into company
# property_valuation_price_type property
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount,company_id,
@ -90,7 +90,7 @@ class account_analytic_line(osv.osv):
(prod.name, prod.id,))
if not company_id:
company_id=company_obj._company_default_get(cr, uid, 'account.analytic.line', context)
# Compute based on pricetype
pricetype=self.pool.get('product.price.type').browse(cr,uid,company_obj.browse(cr,uid,company_id).property_valuation_price_type.id)
# Take the company currency as the reference one
@ -164,10 +164,10 @@ timesheet_invoice()
class res_partner(osv.osv):
""" Inherits partner and adds contract information in the partner form """
_inherit = 'res.partner'
_columns = {
'contract_ids': fields.one2many('account.analytic.account', \
'partner_id', 'Contracts'),
'partner_id', 'Contracts'),
}
res_partner()

View File

@ -142,13 +142,12 @@
<group col='15' colspan='4'>
<field name="name"/>
<field name="employee_id"/>
<field name="department_id"/>
<field name="date_start"/>
<field name="date_end"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="20">
<filter string="Department" icon="terp-project" domain="[]" context="{'group_by':'department_id'}"/>
<filter string="Wage Type" icon="terp-project" domain="[]" context="{'group_by':'wage_type_id'}"/>
</group>
</search>
</field>

View File

@ -43,16 +43,16 @@ class hr_analytic_timesheet(osv.osv):
_inherits = {'account.analytic.line': 'line_id'}
_order = "id desc"
_columns = {
'line_id' : fields.many2one('account.analytic.line', 'Analytic line', ondelete='cascade'),
'line_id' : fields.many2one('account.analytic.line', 'Analytic line', ondelete='cascade'),
'partner_id': fields.related('account_id', 'partner_id', type='many2one', string='Partner Id',relation='account.analytic.account',store=True),
}
def unlink(self, cr, uid, ids, context={}):
toremove = {}
for obj in self.browse(cr, uid, ids, context):
for obj in self.browse(cr, uid, ids, context=context):
toremove[obj.line_id.id] = True
self.pool.get('account.analytic.line').unlink(cr, uid, toremove.keys(), context)
return super(hr_analytic_timesheet, self).unlink(cr, uid, ids, context)
self.pool.get('account.analytic.line').unlink(cr, uid, toremove.keys(), context=context)
return super(hr_analytic_timesheet, self).unlink(cr, uid, ids, context=context)
def on_change_unit_amount(self, cr, uid, id, prod_id, unit_amount, unit, context={}):
@ -60,30 +60,34 @@ class hr_analytic_timesheet(osv.osv):
# if prod_id and unit_amount:
if prod_id:
# find company
company_id=self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context)
res = self.pool.get('account.analytic.line').on_change_unit_amount(cr, uid, id, prod_id, unit_amount,company_id,unit, context)
company_id = self.pool.get('res.company')._company_default_get(cr, uid, 'account.analytic.line', context=context)
res = self.pool.get('account.analytic.line').on_change_unit_amount(cr, uid, id, prod_id, unit_amount, company_id, unit, context=context)
return res
def _getEmployeeProduct(self, cr, uid, context):
def _getEmployeeProduct(self, cr, uid, context={}):
emp_obj = self.pool.get('hr.employee')
emp_id = emp_obj.search(cr, uid, [('user_id', '=', context.get('user_id', uid))])
if emp_id:
emp=emp_obj.browse(cr, uid, emp_id[0], context)
emp=emp_obj.browse(cr, uid, emp_id[0], context=context)
if emp.product_id:
return emp.product_id.id
return False
def _getEmployeeUnit(self, cr, uid, context):
def _getEmployeeUnit(self, cr, uid, context=None):
emp_obj = self.pool.get('hr.employee')
if context is None:
context = {}
emp_id = emp_obj.search(cr, uid, [('user_id', '=', context.get('user_id', uid))])
if emp_id:
emp=emp_obj.browse(cr, uid, emp_id[0], context)
emp=emp_obj.browse(cr, uid, emp_id[0], context=context)
if emp.product_id:
return emp.product_id.uom_id.id
return False
def _getGeneralAccount(self, cr, uid, context):
def _getGeneralAccount(self, cr, uid, context=None):
emp_obj = self.pool.get('hr.employee')
if context is None:
context = {}
emp_id = emp_obj.search(cr, uid, [('user_id', '=', context.get('user_id', uid))])
if emp_id:
emp = emp_obj.browse(cr, uid, emp_id[0], context=context)
@ -95,8 +99,10 @@ class hr_analytic_timesheet(osv.osv):
return a
return False
def _getAnalyticJournal(self, cr, uid, context):
def _getAnalyticJournal(self, cr, uid, context=None):
emp_obj = self.pool.get('hr.employee')
if context is None:
context = {}
emp_id = emp_obj.search(cr, uid, [('user_id', '=', context.get('user_id', uid))])
if emp_id:
emp = emp_obj.browse(cr, uid, emp_id[0], context=context)
@ -110,7 +116,7 @@ class hr_analytic_timesheet(osv.osv):
'product_id' : _getEmployeeProduct,
'general_account_id' : _getGeneralAccount,
'journal_id' : _getAnalyticJournal,
'date' : lambda self,cr,uid,ctx: ctx.get('date', time.strftime('%Y-%m-%d')),
'date' : lambda self, cr, uid, ctx : ctx.get('date', time.strftime('%Y-%m-%d')),
'user_id' : lambda obj, cr, uid, ctx : ctx.get('user_id', uid),
}
def on_change_account_id(self, cr, uid, ids, account_id):
@ -147,5 +153,4 @@ class hr_analytic_timesheet(osv.osv):
}}
hr_analytic_timesheet()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -61,10 +61,6 @@
help="Timesheet lines during last 7 days"/>
<separator orientation="vertical"/>
<field name="user_id" widget="selection">
<filter icon="terp-hr"
string="My timesheet lines"
help = "My timesheet lines"
domain="[('user_id','=',uid)]" />
<filter icon="terp-hr"
string="Non Assigned timesheets to users"
help="Non Assigned timesheets to users"
@ -74,22 +70,22 @@
<field name="product_id"/>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<field name="date"/>
<separator orientation="vertical"/>
<field name="invoice_id" widget="selection"/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Account" icon="terp-hr" context="{'group_by':'account_id'}"/>
<filter string="Product" icon="terp-hr" context="{'group_by':'product_id'}"/>
<filter string="Invoice" icon="terp-hr" context="{'group_by':'invoice_id'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-hr" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-hr" context="{'group_by':'name'}"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
<separator orientation="vertical"/>
<filter string="Account" icon="terp-hr" context="{'group_by':'account_id'}"/>
<filter string="Product" icon="terp-hr" context="{'group_by':'product_id'}"/>
<filter string="Invoice" icon="terp-hr" context="{'group_by':'invoice_id'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-hr" context="{'group_by':'month'}"/>
<filter string="Year" icon="terp-hr" context="{'group_by':'name'}"/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<field name="date"/>
<separator orientation="vertical"/>
<field name="invoice_id" widget="selection"/>
</group>
</search>
</field>
@ -100,7 +96,7 @@
<field name="res_model">report.timesheet.line</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'search_default_user_id':uid,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_timesheet_line_search"/>
</record>
<menuitem action="action_timesheet_line_stat_all" id="menu_report_timesheet_line_all" parent="hr.menu_hr_reporting"/>
@ -491,6 +487,7 @@
<field name="res_model">random.timesheet.lines</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_user_id':uid }</field>
<field name="view_id" ref="view_random_timesheet_lines_tree"/>
</record>
<!--Time Tracking menu in project Management-->

View File

@ -27,14 +27,13 @@ import netsvc
from mx import DateTime
from tools.translate import _
class one2many_mod2(fields.one2many):
def get(self, cr, obj, ids, name, user=None, offset=0, context={}, values={}):
res = {}
for id in ids:
res[id] = []
res5 = obj.read(cr, user, ids, ['date_current', 'user_id'], context)
res5 = obj.read(cr, user, ids, ['date_current', 'user_id'], context=context)
res6 = {}
for r in res5:
res6[r['id']] = (r['date_current'], r['user_id'][0])
@ -71,7 +70,7 @@ class one2many_mod(fields.one2many):
for id in ids:
res[id] = []
res5 = obj.read(cr, user, ids, ['date_current', 'user_id'], context)
res5 = obj.read(cr, user, ids, ['date_current', 'user_id'], context=context)
res6 = {}
for r in res5:
res6[r['id']] = (r['date_current'], r['user_id'][0])
@ -111,8 +110,10 @@ class hr_timesheet_sheet(osv.osv):
res[record[0]]['total_difference_day'] = record[3]
return res
def _total(self, cr, uid, ids, name, args, context):
def _total(self, cr, uid, ids, name, args, context=None):
res = {}
if context is None:
context = {}
cr.execute('SELECT s.id, COALESCE(SUM(d.total_attendance),0), COALESCE(SUM(d.total_timesheet),0), COALESCE(SUM(d.total_difference),0) \
FROM hr_timesheet_sheet_sheet s \
LEFT JOIN hr_timesheet_sheet_sheet_day d \
@ -125,13 +126,15 @@ class hr_timesheet_sheet(osv.osv):
res[record[0]]['total_difference'] = record[3]
return res
def _state_attendance(self, cr, uid, ids, name, args, context):
def _state_attendance(self, cr, uid, ids, name, args, context=None):
emp_obj = self.pool.get('hr.employee')
result = {}
link_emp = {}
emp_ids = []
emp_obj = self.pool.get('hr.employee')
if context is None:
context = {}
for sheet in self.browse(cr, uid, ids, context):
for sheet in self.browse(cr, uid, ids, context=context):
result[sheet.id] = 'none'
emp_ids2 = emp_obj.search(cr, uid,
[('user_id', '=', sheet.user_id.id)])
@ -147,8 +150,10 @@ class hr_timesheet_sheet(osv.osv):
def copy(self, cr, uid, ids, *args, **argv):
raise osv.except_osv(_('Error !'), _('You can not duplicate a timesheet !'))
def button_confirm(self, cr, uid, ids, context):
for sheet in self.browse(cr, uid, ids, context):
def button_confirm(self, cr, uid, ids, context=None):
if context is None:
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
di = sheet.user_id.company_id.timesheet_max_difference
if (abs(sheet.total_difference) < di) or not di:
wf_service = netsvc.LocalService("workflow")
@ -157,8 +162,10 @@ class hr_timesheet_sheet(osv.osv):
raise osv.except_osv(_('Warning !'), _('Please verify that the total difference of the sheet is lower than %.2f !') %(di,))
return True
def date_today(self, cr, uid, ids, context):
for sheet in self.browse(cr, uid, ids, context):
def date_today(self, cr, uid, ids, context=None):
if context is None:
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
if DateTime.now() <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,})
elif DateTime.now() >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'):
@ -167,8 +174,10 @@ class hr_timesheet_sheet(osv.osv):
self.write(cr, uid, [sheet.id], {'date_current': time.strftime('%Y-%m-%d')})
return True
def date_previous(self, cr, uid, ids, context):
for sheet in self.browse(cr, uid, ids, context):
def date_previous(self, cr, uid, ids, context=None):
if context is None:
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
if DateTime.strptime(sheet.date_current, '%Y-%m-%d') <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,})
else:
@ -177,8 +186,10 @@ class hr_timesheet_sheet(osv.osv):
})
return True
def date_next(self, cr, uid, ids, context):
for sheet in self.browse(cr, uid, ids, context):
def date_next(self, cr, uid, ids, context=None):
if context is None:
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
if DateTime.strptime(sheet.date_current, '%Y-%m-%d') >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,})
else:
@ -187,27 +198,33 @@ class hr_timesheet_sheet(osv.osv):
})
return True
def button_dummy(self, cr, uid, ids, context):
for sheet in self.browse(cr, uid, ids, context):
def button_dummy(self, cr, uid, ids, context=None):
if context is None:
context = {}
for sheet in self.browse(cr, uid, ids, context=context):
if DateTime.strptime(sheet.date_current, '%Y-%m-%d') <= DateTime.strptime(sheet.date_from, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_from,})
elif DateTime.strptime(sheet.date_current, '%Y-%m-%d') >= DateTime.strptime(sheet.date_to, '%Y-%m-%d'):
self.write(cr, uid, [sheet.id], {'date_current': sheet.date_to,})
return True
def sign_in(self, cr, uid, ids, context):
def sign_in(self, cr, uid, ids, context=None):
emp_obj = self.pool.get('hr.employee')
if context is None:
context = {}
if not self.browse(cr, uid, ids, context)[0].date_current == time.strftime('%Y-%m-%d'):
raise osv.except_osv(_('Error !'), _('You can not sign in from an other date than today'))
emp_obj = self.pool.get('hr.employee')
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
context['sheet_id']=ids[0]
success = emp_obj.attendance_action_change(cr, uid, emp_id, type='sign_in', context=context,)
return True
def sign_out(self, cr, uid, ids, context):
def sign_out(self, cr, uid, ids, context=None):
emp_obj = self.pool.get('hr.employee')
if context is None:
context = {}
if not self.browse(cr, uid, ids, context)[0].date_current == time.strftime('%Y-%m-%d'):
raise osv.except_osv(_('Error !'), _('You can not sign out from an other date than today'))
emp_obj = self.pool.get('hr.employee')
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)])
context['sheet_id']=ids[0]
success = emp_obj.attendance_action_change(cr, uid, emp_id, type='sign_out', context=context,)
@ -250,7 +267,7 @@ class hr_timesheet_sheet(osv.osv):
}
def _default_date_from(self,cr, uid, context={}):
user = self.pool.get('res.users').browse(cr, uid, uid, context)
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
r = user.company_id and user.company_id.timesheet_range or 'month'
if r=='month':
return time.strftime('%Y-%m-01')
@ -261,7 +278,7 @@ class hr_timesheet_sheet(osv.osv):
return time.strftime('%Y-%m-%d')
def _default_date_to(self,cr, uid, context={}):
user = self.pool.get('res.users').browse(cr, uid, uid, context)
user = self.pool.get('res.users').browse(cr, uid, uid, context=context)
r = user.company_id and user.company_id.timesheet_range or 'month'
if r=='month':
return (DateTime.now() + DateTime.RelativeDateTime(months=+1,day=1,days=-1)).strftime('%Y-%m-%d')
@ -276,8 +293,8 @@ class hr_timesheet_sheet(osv.osv):
'date_from' : _default_date_from,
'date_current' : lambda *a: time.strftime('%Y-%m-%d'),
'date_to' : _default_date_to,
'state': lambda *a: 'new',
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr_timesheet_sheet.sheet', context=c)
'state': 'new',
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'hr_timesheet_sheet.sheet', context=c)
}
def _sheet_date(self, cr, uid, ids):
@ -301,7 +318,7 @@ class hr_timesheet_sheet(osv.osv):
_constraints = [
(_sheet_date, 'You can not have 2 timesheets that overlaps !\nPlease use the menu \'My Current Timesheet\' to avoid this problem.', ['date_from','date_to']),
(_date_current_check, 'You must select a Current date wich is in the timesheet dates !', ['date_current']),
(_date_current_check, 'You must select a Current date which is in the timesheet dates !', ['date_current']),
]
def action_set_to_draft(self, cr, uid, ids, *args):
@ -319,6 +336,8 @@ class hr_timesheet_sheet(osv.osv):
context, load='_classic_write')]
def unlink(self, cr, uid, ids, context=None):
if context is None:
context = {}
sheets = self.read(cr, uid, ids, ['state','total_attendance'])
for sheet in sheets:
if sheet['state'] in ('confirm', 'done'):

View File

@ -220,7 +220,7 @@
<field name="res_model">hr_timesheet_sheet.sheet</field>
<field name="view_type">form</field>
<field name="view_id" eval="False"/>
<field name="context">{'search_default_my_timesheet':1}</field>
<field name="context">{'search_default_my_timesheet':1, 'search_default_user_id':uid }</field>
<field name="search_view_id" ref="view_hr_timesheet_sheet_filter"/>
</record>

View File

@ -68,10 +68,6 @@
domain="[('state','=','done')]"/>
<separator orientation="vertical"/>
<field name="user_id" widget="selection">
<filter icon="terp-hr"
string="My timesheet"
help = "My timesheet "
domain="[('user_id','=',uid)]" />
<filter icon="terp-hr"
string="Non Assigned timesheets to users"
help="Non Assigned timesheets to users"
@ -80,28 +76,28 @@
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<filter icon="terp-hr"
string="New"
domain="[('state','=','new')]"/>
<separator orientation="vertical"/>
<field name="department_id" widget="selection"/>
<separator orientation="vertical"/>
<field name="date_from"/>
<field name="date_to"/>
</group>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-hr" context="{'group_by':'date_current'}"/>
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="10" col="12">
<filter string="User" name="User" icon="terp-hr" context="{'group_by':'user_id'}"/>
<filter string="Company" icon="terp-hr" context="{'group_by':'company_id'}" groups="base.group_multi_company"/>
<separator orientation="vertical"/>
<filter string="Department" icon="terp-hr" context="{'group_by':'department_id'}"/>
<filter string="State" icon="terp-hr" context="{'group_by':'state'}"/>
<separator orientation="vertical"/>
<filter string="Day" icon="terp-hr" context="{'group_by':'day'}"/>
<filter string="Month" icon="terp-hr" context="{'group_by':'date_current'}"/>
<filter string="Year" icon="terp-hr" context="{'group_by':'year'}"/>
</group>
<group expand="0" string="Extended options..." colspan="10" col="12">
<filter icon="terp-hr"
string="New"
domain="[('state','=','new')]"/>
<separator orientation="vertical"/>
<field name="department_id" widget="selection"/>
<separator orientation="vertical"/>
<field name="date_from"/>
<field name="date_to"/>
</group>
</search>
</field>
</record>
@ -111,7 +107,7 @@
<field name="res_model">timesheet.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'search_default_month':1, 'search_default_User':1, 'search_default_user_id':uid, 'group_by_no_leaf':1,'group_by':[]}</field>
<field name="search_view_id" ref="view_timesheet_report_search"/>
</record>
<menuitem action="action_timesheet_report_stat_all" id="menu_timesheet_report_all" parent="hr.menu_hr_reporting"/>

View File

@ -122,6 +122,7 @@
<field name="user_id" string="Project Manager" default="1"/>
<field name="partner_id" string="Partner"/>
</group>
<newline/>
<group expand="1" string="Group By..." colspan="4" col="20">
<filter string="Users" name="Users" icon="terp-project" domain = "[]" context="{'group_by':'user_id'}"/>
<filter string="Partner" name="Partner" icon="terp-project" domain = "[]" context="{'group_by':'partner_id'}"/>
@ -418,7 +419,6 @@
<filter domain="[('project_id.user_id','=',uid)]" help="My Projects" icon="terp-project"/>
</field>
<field name="user_id" select="1" widget="selection">
<filter domain="[('user_id','=',uid)]" help="My Tasks" icon="gtk-execute" default="1"/>
<filter domain="[('user_id','=',False)]" help="Unassigned Tasks" icon="gtk-execute" separator="1"/>
</field>
</group>
@ -444,7 +444,7 @@
<field name="view_mode">tree,form,calendar,gantt,graph</field>
<field eval="False" name="filter"/>
<field name="view_id" ref="view_task_tree2"/>
<field name="context">{"search_default_project_id":context.get('project_id',False)}</field>
<field name="context">{"search_default_project_id":project_id,'search_default_user_id':uid}</field>
<field name="search_view_id" ref="view_task_search_form"/>
</record>
@ -607,12 +607,10 @@
<group col="20" colspan="4">
<filter domain="[('date','&gt;=',time.strftime('%%Y-%%m-01'))]" icon="terp-project" string="This Month" />
<filter domain="[('date', '=', time.strftime('%%Y-%%m-%%d'))]" icon="terp-project" string="Today" />
<separator orientation="vertical"/>
<field name="subject"/>
<field name="project_id" select="1" widget="selection"/>
<field name="user_id" select="1" widget="selection">
<filter domain="[('user_id','=',uid)]" help="My Message" icon="gtk-execute" default="1"/>
</field>
</group>
<newline/>
@ -631,7 +629,7 @@
<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":context.get('project_id',False), "search_default_my_msg":1}</field>
<field name="context">{"search_default_project_id":project_id, "search_default_my_msg":1, "search_default_user_id":uid}</field>
<field name="search_view_id" ref="view_project_message_search"/>
</record>

View File

@ -79,20 +79,12 @@
help = "Pending tasks"/>
<separator orientation="vertical"/>
<field name="user_id" widget="selection">
<filter icon="terp-project"
string="My Task"
help = "My tasks"
domain="[('user_id','=',uid)]" />
<filter icon="terp-project"
string="Non Assigned Tasks to users"
help="Non Assigned Tasks to users"
domain="[('user_id','=',False)]"/>
</field>
<field name="project_id">
<filter icon="terp-project"
string="My Task"
help="My Tasks"
domain="[('project_id','=',context.get('project_id', False)]"/>
<filter icon="terp-project"
string="Non assigned tasks to projects"
help ="Non assigned tasks to projects"
@ -143,7 +135,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="search_view_id" ref="view_task_project_user_search"/>
<field name="context">{'search_default_month':1,'search_default_User':1,'group_by_no_leaf':1,'group_by':[]}</field>
<field name="context">{'search_default_month':1,'search_default_User':1,'search_default_project_id':project_id,'search_default_user_id':uid,'group_by_no_leaf':1,'group_by':[]}</field>
</record>
<menuitem action="action_project_task_user_tree" id="menu_project_task_user_tree" parent="base.menu_project_report"/>