Merge lp:~julie-w/unifield-server/US-4634 into lp:unifield-server

Proposed by jftempo on 2018-07-09
Status: Merged
Merged at revision: 4968
Proposed branch: lp:~julie-w/unifield-server/US-4634
Merge into: lp:unifield-server
Diff against target: 111 lines (+32/-7)
6 files modified
bin/addons/account_corrections/wizard/journal_items_corrections.py (+4/-1)
bin/addons/account_override/account.py (+3/-2)
bin/addons/msf_profile/i18n/fr_MF.po (+5/-0)
bin/addons/register_accounting/account_bank_statement.py (+5/-1)
bin/addons/register_accounting/account_move_line.py (+5/-1)
bin/addons/register_accounting/wizard/wizard_register_import.py (+10/-2)
To merge this branch: bzr merge lp:~julie-w/unifield-server/US-4634
Reviewer Review Type Date Requested Status
UniField Reviewer Team 2018-07-09 Pending
Review via email: mp+349132@code.launchpad.net
To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/addons/account_corrections/wizard/journal_items_corrections.py'
2--- bin/addons/account_corrections/wizard/journal_items_corrections.py 2018-02-21 16:51:38 +0000
3+++ bin/addons/account_corrections/wizard/journal_items_corrections.py 2018-07-09 08:36:01 +0000
4@@ -350,9 +350,12 @@
5 elif acc_type == 'advance' and not aml.employee_id:
6 raise osv.except_osv(_('Warning'), _('The account "%s - %s" is only compatible '
7 'with an Employee Third Party.') % (account.code, account.name))
8- elif acc_type in ['down_payment', 'payroll'] and not aml.partner_id:
9+ elif acc_type == 'down_payment' and not aml.partner_id:
10 raise osv.except_osv(_('Warning'), _('The account "%s - %s" is only compatible '
11 'with a Partner Third Party.') % (account.code, account.name))
12+ elif acc_type == 'payroll' and not aml.partner_id and not aml.employee_id:
13+ raise osv.except_osv(_('Warning'), _('The account "%s - %s" is only compatible '
14+ 'with a Partner or an Employee Third Party.') % (account.code, account.name))
15 else:
16 # Check the compatibility with the Allowed Partner Types
17 # (according to US-1307 this check is done only when the account has no "Type For Specific Treatment")
18
19=== modified file 'bin/addons/account_override/account.py'
20--- bin/addons/account_override/account.py 2018-04-03 10:18:51 +0000
21+++ bin/addons/account_override/account.py 2018-07-09 08:36:01 +0000
22@@ -643,8 +643,9 @@
23 acc_type = acc_id.type_for_register
24 transfer_not_ok = acc_type in ['transfer', 'transfer_same'] and (not journal_id or partner_id or employee_id)
25 advance_not_ok = acc_type == 'advance' and (not employee_id or journal_id or partner_id)
26- dp_payroll_not_ok = acc_type in ['down_payment', 'payroll'] and (not partner_id or journal_id or employee_id)
27- if transfer_not_ok or advance_not_ok or dp_payroll_not_ok:
28+ dp_not_ok = acc_type == 'down_payment' and (not partner_id or journal_id or employee_id)
29+ payroll_not_ok = acc_type == 'payroll' and ((not partner_id and not employee_id) or journal_id)
30+ if transfer_not_ok or advance_not_ok or dp_not_ok or payroll_not_ok:
31 not_compatible_ids.append(acc_id.id)
32 if not_compatible_ids:
33 self._display_account_partner_compatibility_error(cr, uid, not_compatible_ids, context, type_for_specific_treatment=True)
34
35=== modified file 'bin/addons/msf_profile/i18n/fr_MF.po'
36--- bin/addons/msf_profile/i18n/fr_MF.po 2018-06-15 12:30:42 +0000
37+++ bin/addons/msf_profile/i18n/fr_MF.po 2018-07-09 08:36:01 +0000
38@@ -101265,3 +101265,8 @@
39 msgid "Not Invoice"
40 msgstr "Pas de Facture"
41
42+#. module: account_corrections
43+#: code:addons/account_corrections/wizard/journal_items_corrections.py:357
44+#, python-format
45+msgid "The account \"%s - %s\" is only compatible with a Partner or an Employee Third Party."
46+msgstr "Le compte \"%s - %s\" n'est compatible qu'avec un Tiers de type Partenaire ou Employé."
47
48=== modified file 'bin/addons/register_accounting/account_bank_statement.py'
49--- bin/addons/register_accounting/account_bank_statement.py 2018-06-11 13:34:07 +0000
50+++ bin/addons/register_accounting/account_bank_statement.py 2018-07-09 08:36:01 +0000
51@@ -2983,10 +2983,14 @@
52 third_type = [('hr.employee', 'Employee')]
53 third_required = True
54 third_selection = 'hr.employee,0'
55- elif a['type_for_register'] in ['down_payment', 'payroll']:
56+ elif a['type_for_register'] == 'down_payment':
57 third_type = [('res.partner', 'Partner')]
58 third_required = True
59 third_selection = 'res.partner,0'
60+ elif a['type_for_register'] == 'payroll':
61+ third_type = [('res.partner', 'Partner'), ('hr.employee', 'Employee')]
62+ third_required = True
63+ third_selection = 'res.partner,0'
64 return {'value': {'partner_type_mandatory': third_required, 'partner_type': {'options': third_type, 'selection': third_selection}}}
65
66 def onchange_partner_type(self, cr, uid, ids, partner_type=None, amount_in=None, amount_out=None, context=None):
67
68=== modified file 'bin/addons/register_accounting/account_move_line.py'
69--- bin/addons/register_accounting/account_move_line.py 2017-12-05 17:00:38 +0000
70+++ bin/addons/register_accounting/account_move_line.py 2018-07-09 08:36:01 +0000
71@@ -359,10 +359,14 @@
72 third_type = [('hr.employee', 'Employee')]
73 third_required = True
74 third_selection = 'hr.employee,0'
75- elif acc_type in ['down_payment', 'payroll']:
76+ elif acc_type == 'down_payment':
77 third_type = [('res.partner', 'Partner')]
78 third_required = True
79 third_selection = 'res.partner,0'
80+ elif acc_type == 'payroll':
81+ third_type = [('res.partner', 'Partner'), ('hr.employee', 'Employee')]
82+ third_required = True
83+ third_selection = 'res.partner,0'
84 val.update({'partner_type_mandatory': third_required, 'partner_type': {'options': third_type, 'selection': third_selection}})
85 return {'value': val}
86
87
88=== modified file 'bin/addons/register_accounting/wizard/wizard_register_import.py'
89--- bin/addons/register_accounting/wizard/wizard_register_import.py 2018-03-08 17:25:31 +0000
90+++ bin/addons/register_accounting/wizard/wizard_register_import.py 2018-07-09 08:36:01 +0000
91@@ -484,10 +484,18 @@
92 if tp_journal.currency.id != register_currency:
93 errors.append(_('Line %s. A Transfer Same Journal must have the same currency as the register.') % (current_line_num,))
94 continue
95- # Type DP or payroll ==> PARTNER required
96- elif type_for_register in ['down_payment', 'payroll']:
97+ # Type DP ==> PARTNER required
98+ elif type_for_register == 'down_payment':
99 tp_ids = partner_obj.search(cr, uid, [('name', '=', line[cols['third_party']])], context=context)
100 partner_type = 'partner'
101+ # Type payroll ==> PARTNER or EMPLOYEE required
102+ elif type_for_register == 'payroll':
103+ tp_ids = partner_obj.search(cr, uid, [('name', '=', line[cols['third_party']])], context=context)
104+ if tp_ids:
105+ partner_type = 'partner'
106+ else:
107+ tp_ids = employee_obj.search(cr, uid, [('name', '=', line[cols['third_party']])], context=context)
108+ partner_type = 'employee'
109 # Any type for Spec. Treatment listed above ==> EMPTY partner NOT allowed
110 if not tp_ids:
111 errors.append(

Subscribers

People subscribed via source and target branches