Code review comment for lp://staging/~fabien-morin/unifield-server/fm-us-1198

Revision history for this message
Fabien MORIN (fabien-morin) wrote :

I reverted all this changes.

I did it because the search is called on module 'hr.payroll.msf' and the current class of
self object is also 'hr.payroll.msf'. So I don't see why it could not work.

On Monday 20 February 2017 12:37:27 you wrote:
> Diff comments:
> > === modified file 'bin/addons/msf_homere_interface/hr_payroll.py'
> > --- bin/addons/msf_homere_interface/hr_payroll.py 2016-12-21 08:28:03
> > +0000
> > +++ bin/addons/msf_homere_interface/hr_payroll.py 2017-02-17 09:00:02
> > +0000
> > @@ -169,25 +169,23 @@
> >
> > elif ana_account['category'] == 'FUNDING':
> > fp.append(ana_account['id'])
> >
> > if len(fp) > 1 or len(cc) > 1 or len(dest) > 1:
> > - return self.pool.get('hr.payroll.msf').search(cr, uid,
> > [('state', '=', 'draft'), '|', '|', ('funding_pool_id', 'in', fp),
> > ('cost_center_id','in', cc), ('destination_id','in', dest)])
> Why did you change this ? It does not work.
>
> > + return self.search(cr, uid, [('state', '=', 'draft'), '|',
> > '|', ('funding_pool_id', 'in', fp), ('cost_center_id','in', cc),
> > ('destination_id','in', dest)])>
> > return []
> >
> > def _get_trigger_state_account(self, cr, uid, ids, context=None):
> > - pay_obj = self.pool.get('hr.payroll.msf')
> > - return pay_obj.search(cr, uid, [('state', '=', 'draft'),
> > ('account_id', 'in', ids)]) + return self.search(cr, uid,
> > [('state', '=', 'draft'), ('account_id', 'in', ids)])
> Same issue here
>
> > def _get_trigger_state_dest_link(self, cr, uid, ids, context=None):
> > if isinstance(ids, (int, long)):
> > ids = [ids]
> >
> > to_update = []
> >
> > - pay_obj = self.pool.get('hr.payroll.msf')
> >
> > for dest_link in self.read(cr, uid, ids, ['account_id', 'destination_id',
'funding_pool_ids']):
> > - to_update += pay_obj.search(cr, uid, [
> > - ('state', '=', 'draft'),
> > - ('account_id', '=', dest_link['account_id'][0]),
> > - ('destination_id', '=', dest_link['destination_id'][0]),
> > - ('funding_pool_id', 'in', dest_link['funding_pool_ids'])
> > + to_update += self.search(cr, uid, [
>
> and here.
>
> > + ('state', '=', 'draft'),
> > + ('account_id', '=', dest_link['account_id'][0]),
> > + ('destination_id', '=',
> > dest_link['destination_id'][0]), + ('funding_pool_id',
> > 'in', dest_link['funding_pool_ids'])>
> > ])
> >
> > return to_update

--
Fabien MORIN
TeMPO Consulting
20, avenue de la Paix
67000 Strasbourg
France

http://www.tempo-consulting.fr
Tel : +33 3 88 56 82 16
Fax : +33 9 70 63 35 46

« Back to merge proposal