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
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: msf_homere_ interface/ hr_payroll. py' msf_homere_ interface/ hr_payroll. py 2016-12-21 08:28:03 msf_homere_ interface/ hr_payroll. py 2017-02-17 09:00:02 'category' ] == 'FUNDING': ana_account[ 'id']) get('hr. payroll. msf').search( cr, uid, center_ id','in' , cc), ('destination_ id','in' , dest)]) center_ id','in' , cc), id','in' , dest)])> state_account( self, cr, uid, ids, context=None): get('hr. payroll. msf') state_dest_ link(self, cr, uid, ids, context=None): get('hr. payroll. msf') pool_ids' ]): 'account_ id'][0] ), 'destination_ id'][0] ), 'funding_ pool_ids' ]) 'account_ id'][0] ), 'destination_ id'][0] ), + ('funding_pool_id', 'funding_ pool_ids' ])>
> Diff comments:
> > === modified file 'bin/addons/
> > --- bin/addons/
> > +0000
> > +++ bin/addons/
> > +0000
> > @@ -169,25 +169,23 @@
> >
> > elif ana_account[
> > fp.append(
> >
> > if len(fp) > 1 or len(cc) > 1 or len(dest) > 1:
> > - return self.pool.
> > [('state', '=', 'draft'), '|', '|', ('funding_pool_id', 'in', fp),
> > ('cost_
> Why did you change this ? It does not work.
>
> > + return self.search(cr, uid, [('state', '=', 'draft'), '|',
> > '|', ('funding_pool_id', 'in', fp), ('cost_
> > ('destination_
> > return []
> >
> > def _get_trigger_
> > - pay_obj = self.pool.
> > - 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_
> > if isinstance(ids, (int, long)):
> > ids = [ids]
> >
> > to_update = []
> >
> > - pay_obj = self.pool.
> >
> > for dest_link in self.read(cr, uid, ids, ['account_id', 'destination_id',
'funding_
> > - to_update += pay_obj.search(cr, uid, [
> > - ('state', '=', 'draft'),
> > - ('account_id', '=', dest_link[
> > - ('destination_id', '=', dest_link[
> > - ('funding_pool_id', 'in', dest_link[
> > + to_update += self.search(cr, uid, [
>
> and here.
>
> > + ('state', '=', 'draft'),
> > + ('account_id', '=', dest_link[
> > + ('destination_id', '=',
> > dest_link[
> > 'in', dest_link[
> > ])
> >
> > 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