~unifield-team/unifield-wm/us-957

« back to all changes in this revision

Viewing changes to account_override/account.py

  • Committer: jf
  • Date: 2016-02-08 11:05:33 UTC
  • mfrom: (2753.2.1 unifield-wm)
  • Revision ID: jfb@tempo-consulting.fr-20160208110533-oygb5ro1lwpl6qkt
US-896 [FIX] JE manual entry: display only project journals at project level
lp:~unifield-team/unifield-wm/us-896

Show diffs side-by-side

added added

removed removed

Lines of Context:
489
489
                context=context)[0].company_id.instance_id
490
490
            if self_instance:
491
491
                forbid_levels = []
492
 
                if self_instance.level and self_instance.level == 'coordo':
493
 
                    # BKLG-19/7: forbid creation of MANUAL journal entries
494
 
                    # from COORDO on a PROJECT journal
495
 
                    forbid_levels.append('project')
 
492
                if self_instance.level:
 
493
                    if self_instance.level == 'coordo':
 
494
                        # BKLG-19/7: forbid creation of MANUAL journal entries
 
495
                        # from COORDO on a PROJECT journal
 
496
                        forbid_levels = ['project']
 
497
                    elif self_instance.level == 'project':
 
498
                        # US-896: project should only see project journals
 
499
                        # (coordo register journals sync down to project for
 
500
                        #  example)
 
501
                        forbid_levels = ['coordo', 'section']
496
502
                if forbid_levels:
497
503
                    msf_instance_obj = self.pool.get('msf.instance')
498
504
                    forbid_instance_ids = msf_instance_obj.search(cr, uid,