diff options
| author | psi (Open ERP) <psi@tinyerp.co.in> | 2010-05-19 18:37:03 +0530 |
|---|---|---|
| committer | psi (Open ERP) <psi@tinyerp.co.in> | 2010-05-19 18:37:03 +0530 |
| commit | 84dfed9da7c2a0e5e7a681aacfe2296cf1f2f5bf (patch) | |
| tree | 2443e289a21ba6748c78ec623e7a1a56e3c54cc5 /addons | |
| parent | 8eb0e6376fcec87125e193652507b31c824e1623 (diff) | |
[IMP] account, hr_contract, hr_timesheet, project: small changes, clean
bzr revid: psi@tinyerp.co.in-20100519130703-fgog8lo8zgh8g4rk
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account/account_analytic_line.py | 22 | ||||
| -rw-r--r-- | addons/hr_contract/hr_contract_view.xml | 4 | ||||
| -rw-r--r-- | addons/hr_timesheet/hr_timesheet.py | 35 | ||||
| -rw-r--r-- | addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml | 35 | ||||
| -rw-r--r-- | addons/hr_timesheet_sheet/hr_timesheet_sheet.py | 72 | ||||
| -rw-r--r-- | addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml | 2 | ||||
| -rw-r--r-- | addons/hr_timesheet_sheet/report/timesheet_report_view.xml | 48 | ||||
| -rw-r--r-- | addons/project/project_view.xml | 8 | ||||
| -rw-r--r-- | addons/project/report/project_report_view.xml | 10 |
9 files changed, 123 insertions, 113 deletions
diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index ce6341cc9b2..fa28f13b42e 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -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() diff --git a/addons/hr_contract/hr_contract_view.xml b/addons/hr_contract/hr_contract_view.xml index 9951a9e3982..66e1fba946a 100644 --- a/addons/hr_contract/hr_contract_view.xml +++ b/addons/hr_contract/hr_contract_view.xml @@ -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="Contract Type" icon="terp-project" domain="[]" context="{'group_by':'type_id'}"/> </group> </search> </field> @@ -203,6 +202,7 @@ <field name="date_start"/> <field name="date_end"/> <field name="working_hours"/> + <field name="type_id"/> <field name="wage_type_id"/> <field name="wage"/> </tree> diff --git a/addons/hr_timesheet/hr_timesheet.py b/addons/hr_timesheet/hr_timesheet.py index 25c61483391..9b53eaa8828 100644 --- a/addons/hr_timesheet/hr_timesheet.py +++ b/addons/hr_timesheet/hr_timesheet.py @@ -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:
\ No newline at end of file diff --git a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml index cb6c8d5771c..373bd3c7907 100644 --- a/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml +++ b/addons/hr_timesheet_invoice/report/hr_timesheet_invoice_report_view.xml @@ -62,10 +62,6 @@ <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" domain="[('user_id','=',False)]"/> @@ -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--> diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index b7d395ac2e0..26e16da955a 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -27,6 +27,8 @@ import netsvc from mx import DateTime from tools.translate import _ +import sql_db + class one2many_mod2(fields.one2many): def get(self, cr, obj, ids, name, user=None, offset=0, context={}, values={}): @@ -34,7 +36,7 @@ class one2many_mod2(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]) @@ -71,7 +73,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 +113,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 +129,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 +153,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 +165,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 +177,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 +189,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 +201,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 +270,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 +281,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 +296,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 +321,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 +339,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'): diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml index eae4e8e1e9a..4ea4fdb1c75 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml @@ -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> diff --git a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml index 976b2a6f8ea..1f9e70970a3 100644 --- a/addons/hr_timesheet_sheet/report/timesheet_report_view.xml +++ b/addons/hr_timesheet_sheet/report/timesheet_report_view.xml @@ -69,10 +69,6 @@ <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" domain="[('user_id','=',False)]"/> @@ -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"/> diff --git a/addons/project/project_view.xml b/addons/project/project_view.xml index cec9ed95c0c..005e76e44ab 100644 --- a/addons/project/project_view.xml +++ b/addons/project/project_view.xml @@ -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','>=',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> diff --git a/addons/project/report/project_report_view.xml b/addons/project/report/project_report_view.xml index a4a072849b9..1da8311f363 100644 --- a/addons/project/report/project_report_view.xml +++ b/addons/project/report/project_report_view.xml @@ -80,20 +80,12 @@ <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" domain="[('project_id','=',False"/> @@ -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"/> |
