Merge lp:~unifield-team/unifield-wm/us-960-delete-regline into lp:unifield-wm

Proposed by jftempo
Status: Needs review
Proposed branch: lp:~unifield-team/unifield-wm/us-960-delete-regline
Merge into: lp:unifield-wm
Diff against target: 35 lines (+10/-1)
2 files modified
msf_homere_interface/wizard/hr_payroll_employee_import.py (+8/-0)
register_accounting/account_bank_statement.py (+2/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-wm/us-960-delete-regline
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+287273@code.launchpad.net
To post a comment you must log in.

Unmerged revisions

2772. By dvo@dvo

US-671: Search for the cost center from codeterrain and set this value, if not, set empty

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'msf_homere_interface/wizard/hr_payroll_employee_import.py'
2--- msf_homere_interface/wizard/hr_payroll_employee_import.py 2015-05-28 12:04:30 +0000
3+++ msf_homere_interface/wizard/hr_payroll_employee_import.py 2016-02-26 09:22:42 +0000
4@@ -385,9 +385,17 @@
5 # Check job
6 if contract.job_id:
7 vals.update({'job_id': contract.job_id.id})
8+
9 # Desactivate employee if no current contract
10 if not current_contract:
11 vals.update({'active': False})
12+
13+ # US-671: Search for the cost center from codeterrain and set this value, if not, set empty
14+ account_analytic_obj = self.pool.get('account.analytic.account')
15+ cc_ids = account_analytic_obj.search(cr, uid,[('code', '=', codeterrain)])
16+ if cc_ids and len(cc_ids) == 1:
17+ vals.update({'cost_center_id': cc_ids[0],})
18+
19 if not e_ids:
20 res = self.pool.get('hr.employee').create(cr, uid, vals, {'from': 'import'})
21 if res:
22
23=== modified file 'register_accounting/account_bank_statement.py'
24--- register_accounting/account_bank_statement.py 2016-01-25 11:23:45 +0000
25+++ register_accounting/account_bank_statement.py 2016-02-26 09:22:42 +0000
26@@ -2383,7 +2383,8 @@
27 if st_line.state == "hard":
28 raise osv.except_osv(_('Error'), _('You are not allowed to delete hard posting lines!'))
29 else:
30- self.pool.get('account.move').unlink(cr, uid, [x.id for x in st_line.move_ids])
31+ #US-960: No need to set the check flag to True when unlink a reg line, otherwise it could regenerate wrongly new AJIs!
32+ self.pool.get('account.move').unlink(cr, uid, [x.id for x in st_line.move_ids], context=context, check=False)
33 # Delete direct invoice if exists
34 if st_line.direct_invoice and st_line.invoice_id and not context.get('from_direct_invoice', False):
35 # unlink moves and analytic lines before deleting the line

Subscribers

People subscribed via source and target branches