Merge lp:~camptocamp/openobject-addons/trunk-fix-1178617 into lp:openobject-addons

Proposed by Yannick Vaucher @ Camptocamp
Status: Needs review
Proposed branch: lp:~camptocamp/openobject-addons/trunk-fix-1178617
Merge into: lp:openobject-addons
Diff against target: 36 lines (+22/-1)
1 file modified
hr_timesheet/hr_timesheet.py (+22/-1)
To merge this branch: bzr merge lp:~camptocamp/openobject-addons/trunk-fix-1178617
Reviewer Review Type Date Requested Status
OpenERP Core Team Pending
Review via email: mp+170348@code.launchpad.net

Description of the change

Patch taken from code of hr_timesheet_improvement

To post a comment you must log in.

Unmerged revisions

8777. By Yannick Vaucher @ Camptocamp

[FIX] hr_timesheet - details tab must be sorted by date

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hr_timesheet/hr_timesheet.py'
--- hr_timesheet/hr_timesheet.py 2013-04-29 15:14:10 +0000
+++ hr_timesheet/hr_timesheet.py 2013-06-19 13:19:06 +0000
@@ -69,10 +69,31 @@
69 _table = 'hr_analytic_timesheet'69 _table = 'hr_analytic_timesheet'
70 _description = "Timesheet Line"70 _description = "Timesheet Line"
71 _inherits = {'account.analytic.line': 'line_id'}71 _inherits = {'account.analytic.line': 'line_id'}
72 _order = "id desc"72 _order = "date_aal DESC, account_name ASC"
73
74 def _get_account_analytic_line(self, cr, uid, ids, context=None):
75 ts_line_ids = self.pool.get('hr.analytic.timesheet').search(cr, uid, [('line_id', 'in', ids)])
76 return ts_line_ids
77
78 def _get_account_analytic_account(self, cr, uid, ids, context=None):
79 ts_line_ids = self.pool.get('hr.analytic.timesheet').search(cr, uid, [('account_id', 'in', ids)])
80 return ts_line_ids
81
73 _columns = {82 _columns = {
74 'line_id': fields.many2one('account.analytic.line', 'Analytic Line', ondelete='cascade', required=True),83 'line_id': fields.many2one('account.analytic.line', 'Analytic Line', ondelete='cascade', required=True),
75 'partner_id': fields.related('account_id', 'partner_id', type='many2one', string='Partner', relation='res.partner', store=True),84 'partner_id': fields.related('account_id', 'partner_id', type='many2one', string='Partner', relation='res.partner', store=True),
85
86 'date_aal': fields.related('line_id', 'date', string="Analytic Line Date", type='date',
87 store={
88 'account.analytic.line': (_get_account_analytic_line, ['date'], 10),
89 'hr.analytic.timesheet': (lambda self,cr,uid,ids,context=None: ids, None, 10),
90 }),
91 'account_name': fields.related('account_id', 'name', string="Analytic Account Name", type='char', size=256,
92 store={
93 'account.analytic.account': (_get_account_analytic_account, ['name'], 10),
94 'hr.analytic.timesheet': (lambda self,cr,uid,ids,context=None: ids, None, 10),
95 }
96 ),
76 }97 }
7798
78 def unlink(self, cr, uid, ids, context=None):99 def unlink(self, cr, uid, ids, context=None):

Subscribers

People subscribed via source and target branches

to all changes: