Merge lp:~unifield-team/unifield-wm/UFTP-78 into lp:unifield-wm

Proposed by Olivier DOSSMANN
Status: Merged
Merged at revision: 2294
Proposed branch: lp:~unifield-team/unifield-wm/UFTP-78
Merge into: lp:unifield-wm
Diff against target: 201 lines (+71/-9)
7 files modified
.project (+17/-0)
.pydevproject (+10/-0)
.settings/org.eclipse.core.resources.prefs (+15/-0)
register_accounting/account_bank_statement.py (+16/-1)
register_accounting/account_view.xml (+6/-3)
register_accounting/wizard/wizard_register_import.py (+6/-4)
register_accounting/wizard/wizard_register_import.xml (+1/-1)
To merge this branch: bzr merge lp:~unifield-team/unifield-wm/UFTP-78
Reviewer Review Type Date Requested Status
UniField Reviewer Team Pending
Review via email: mp+234993@code.launchpad.net

Description of the change

To see changes made.

To post a comment you must log in.
2208. By Sean Carroll

UFTP-78:[FIX] restricted accounts

2209. By Olivier DOSSMANN

UFTP-78 [MERGE] Last unifield trunk

2210. By Olivier DOSSMANN

UFTP-78 [FIX] Register lines import: wrong domain name for RESTRICTED_ACCOUNT_AREA choice to restrict lines at import

2211. By Olivier DOSSMANN

UFTP-78 [FIX] Register line import: Allow 10210 accounts to be imported.

2212. By Olivier DOSSMANN

UFTP-78 [FIX] Code 10210 should be not restricted

2213. By Olivier DOSSMANN

UFTP-78 [FIX] Problem with red lines on cheque registers

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.project'
2--- .project 1970-01-01 00:00:00 +0000
3+++ .project 2014-10-10 10:21:16 +0000
4@@ -0,0 +1,17 @@
5+<?xml version="1.0" encoding="UTF-8"?>
6+<projectDescription>
7+ <name>utp1017-unifield-wm</name>
8+ <comment></comment>
9+ <projects>
10+ </projects>
11+ <buildSpec>
12+ <buildCommand>
13+ <name>org.python.pydev.PyDevBuilder</name>
14+ <arguments>
15+ </arguments>
16+ </buildCommand>
17+ </buildSpec>
18+ <natures>
19+ <nature>org.python.pydev.pythonNature</nature>
20+ </natures>
21+</projectDescription>
22
23=== added file '.pydevproject'
24--- .pydevproject 1970-01-01 00:00:00 +0000
25+++ .pydevproject 2014-10-10 10:21:16 +0000
26@@ -0,0 +1,10 @@
27+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
28+<?eclipse-pydev version="1.0"?>
29+
30+<pydev_project>
31+<pydev_pathproperty name="org.python.pydev.PROJECT_SOURCE_PATH">
32+<path>/${PROJECT_DIR_NAME}</path>
33+</pydev_pathproperty>
34+<pydev_property name="org.python.pydev.PYTHON_PROJECT_VERSION">python 2.7</pydev_property>
35+<pydev_property name="org.python.pydev.PYTHON_PROJECT_INTERPRETER">Default</pydev_property>
36+</pydev_project>
37
38=== added directory '.settings'
39=== added file '.settings/org.eclipse.core.resources.prefs'
40--- .settings/org.eclipse.core.resources.prefs 1970-01-01 00:00:00 +0000
41+++ .settings/org.eclipse.core.resources.prefs 2014-10-10 10:21:16 +0000
42@@ -0,0 +1,15 @@
43+#Tue Jun 17 16:29:53 CEST 2014
44+eclipse.preferences.version=1
45+encoding//account_hq_entries/hq_entries.py=utf-8
46+encoding//account_hq_entries/wizard/hq_entries_split.py=utf-8
47+encoding//analytic_distribution/account.py=utf-8
48+encoding//analytic_distribution/analytic_account.py=utf-8
49+encoding//analytic_distribution/analytic_distribution.py=utf-8
50+encoding//analytic_distribution/invoice.py=utf-8
51+encoding//analytic_distribution/wizard/analytic_distribution_wizard.py=utf-8
52+encoding//financing_contract/contract.py=utf-8
53+encoding//financing_contract/format_line.py=utf-8
54+encoding//msf_button_access_rights/osv_override.py=utf-8
55+encoding//msf_currency_revaluation/res_currency.py=utf-8
56+encoding//register_accounting/account_bank_statement.py=utf-8
57+encoding//register_accounting/wizard/wizard_register_import.py=utf-8
58
59=== modified file 'register_accounting/account_bank_statement.py'
60--- register_accounting/account_bank_statement.py 2014-10-07 07:50:37 +0000
61+++ register_accounting/account_bank_statement.py 2014-10-10 10:21:16 +0000
62@@ -427,7 +427,7 @@
63 create_cashbox_lines(self, cr, uid, reg.id, context=context)
64 # For bank statement, give balance_end
65 elif reg.journal_id.type == 'bank':
66- # Verify that another bank statement exists
67+ # Verify that another bank statement exists.
68 st_prev_ids = self.search(cr, uid, [('prev_reg_id', '=', reg.id)], context=context)
69 if len(st_prev_ids) > 1:
70 raise osv.except_osv(_('Error'), _('A problem occured: More than one register have this one as previous register!'))
71@@ -974,6 +974,8 @@
72 """
73 Get all analytic lines linked to the given register lines
74 """
75+
76+ print '_get_fp_analytic_lines:', ids
77 if not context:
78 context = {}
79
80@@ -987,6 +989,18 @@
81 res[absl.id] = aal_obj.get_corrections_history(cr, uid, aal_ids, context=context)
82 return res
83
84+ def _check_red_on_supplier(self, cr, uid, ids, name, arg, context=None):
85+ result = {}
86+ for id in ids:
87+ result[id] = {'red_on_supplier': False}
88+
89+ for out in self.browse(cr, uid, ids, context=context):
90+ type_for_register = out.account_id.type_for_register
91+ if type_for_register in ['advance','transfer_same','down_payment','transfer']:
92+ if out.partner_id.id is False and out.employee_id.id is False and out.transfer_journal_id.id is False:
93+ result[out.id]['red_on_supplier'] = True
94+ return result
95+
96 _columns = {
97 'transfer_journal_id': fields.many2one("account.journal", "Journal", ondelete="restrict"),
98 'employee_id': fields.many2one("hr.employee", "Employee", ondelete="restrict"),
99@@ -1027,6 +1041,7 @@
100 ('transfer', 'Internal Transfer'), ('transfer_same', 'Internal Transfer (same currency)'), ('advance', 'Operational Advance'),
101 ('payroll', 'Third party required - Payroll'), ('down_payment', 'Down payment'), ('donation', 'Donation')] , readonly=True),
102 'fp_analytic_lines': fields.function(_get_fp_analytic_lines, type="one2many", obj="account.analytic.line", method=True, string="Analytic lines linked to the given register line(s). Correction(s) included."),
103+ 'red_on_supplier': fields.function(_check_red_on_supplier, method=True, type="boolean", string="Supplier flag", store=False, readonly=True, multi="m"),
104 'journal_id': fields.related('statement_id','journal_id', string="Journal", type='many2one', relation='account.journal', readonly=True),
105 }
106
107
108=== modified file 'register_accounting/account_view.xml'
109--- register_accounting/account_view.xml 2014-09-23 08:09:20 +0000
110+++ register_accounting/account_view.xml 2014-10-10 10:21:16 +0000
111@@ -52,8 +52,9 @@
112 <notebook colspan="4">
113 <page string="Transaction" name="statement_line_ids">
114 <field colspan="4" name="line_ids" nolabel="1">
115- <tree editable="bottom" string="Statement lines" noteditable="state=='hard' or direct_invoice is True" colors="red:(display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')) or (type_for_register == 'transfer' and transfer_amount == 0.0 and state in ('draft', 'temp'))">
116+ <tree editable="bottom" string="Statement lines" noteditable="state=='hard' or direct_invoice is True" colors="red:(display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')) or (type_for_register == 'transfer' and transfer_amount == 0.0 and state in ('draft', 'temp')) or red_on_supplier == True">
117 <field name="transfer_amount" invisible="1"/>
118+ <field name="red_on_supplier" invisible="1"/>
119 <button name="button_duplicate" string="Duplicate" type="object" icon="gtk-copy" />
120 <button name="button_analytic_lines" string="Analytic lines" type="object" icon="terp-stock_zoom" />
121 <field name="document_date" attrs="{'readonly': [('from_import_cheque_id', '!=', False)]}"/>
122@@ -194,7 +195,7 @@
123 <notebook colspan="4">
124 <page string="Cash Transactions" attrs="{'invisible': [('state','=','draft')]}">
125 <field colspan="4" name="line_ids" nolabel="1">
126- <tree editable="bottom" string="Statement lines" noteditable="state=='hard' or direct_invoice is True" colors="red:(display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')) or (type_for_register == 'transfer' and transfer_amount == 0.0 and state in ('draft', 'temp'))">
127+ <tree editable="bottom" string="Statement lines" noteditable="state=='hard' or direct_invoice is True" colors="red:(display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')) or (type_for_register == 'transfer' and transfer_amount == 0.0 and state in ('draft', 'temp')) or red_on_supplier == True">
128 <field name="transfer_amount" invisible="1"/>
129 <button name="button_duplicate" string="Duplicate" type="object" icon="gtk-copy" />
130 <button name="button_analytic_lines" string="Analytic lines" type="object" icon="terp-stock_zoom" />
131@@ -204,6 +205,7 @@
132 attrs="{'invisible': ['|', ('from_cash_return', '=', True), '|', ('amount', '&gt;=', 0), '|',
133 ('employee_id', '=', False), ('type_for_register','!=','advance')]}"/>
134 <field name="document_date"/>
135+ <field name="red_on_supplier" invisible="1" />
136 <field name="date" />
137 <field name="sequence_for_reference"/>
138 <field name="name" string="Description"/>
139@@ -685,11 +687,12 @@
140 <page string="Transaction" name="statement_line_ids">
141 <field colspan="4" name="line_ids" nolabel="1">
142 <!-- WARNING: because of UTP-331, in cheque register direct invoice lines should be editable but ONLY for cheque_number FIELD. That's why ALL field must be not editable when "direct_invoice" is True. -->
143- <tree editable="bottom" string="Statement lines" noteditable="state=='hard'" colors="red:(display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')) or (type_for_register == 'transfer' and transfer_amount == 0.0 and state in ('draft', 'temp'))">
144+ <tree editable="bottom" string="Statement lines" noteditable="state=='hard'" colors="red:(display_analytic_button and (not analytic_distribution_id or analytic_distribution_state == 'invalid')) or (type_for_register == 'transfer' and transfer_amount == 0.0 and state in ('draft', 'temp')) or red_on_supplier == True">
145 <field name="transfer_amount" invisible="1"/>
146 <button name="button_duplicate" string="Duplicate" type="object" icon="gtk-copy" />
147 <button name="button_analytic_lines" string="Analytic lines" type="object" icon="terp-stock_zoom" />
148 <field name="document_date" attrs="{'readonly': [('direct_invoice', '=', True)]}"/>
149+ <field name="red_on_supplier" invisible="1" />
150 <field name="date" attrs="{'readonly': [('direct_invoice', '=', True)]}"/>
151 <field name="cheque_number" required="1"/>
152 <field name="sequence_for_reference"/>
153
154=== modified file 'register_accounting/wizard/wizard_register_import.py'
155--- register_accounting/wizard/wizard_register_import.py 2014-09-29 12:45:23 +0000
156+++ register_accounting/wizard/wizard_register_import.py 2014-10-10 10:21:16 +0000
157@@ -363,7 +363,6 @@
158 line = self.pool.get('import.cell.data').get_line_values(cr, uid, ids, r)
159 # utp1043 pad the line with False if some trailing columns missing. Occurs on Excel 2003
160 line.extend([False for i in range(len(cols) - len(line))])
161-
162 # Bypass this line if NO debit AND NO credit
163 try:
164 bd = line[cols['amount_in']]
165@@ -427,7 +426,12 @@
166 errors.append(_('Line %s. G/L account %s not found!') % (current_line_num, account_code,))
167 continue
168 r_account = account_ids[0]
169- account = self.pool.get('account.account').read(cr, uid, r_account, ['type_for_register', 'is_analytic_addicted'], context)
170+ account_obj = self.pool.get('account.account')
171+ restricted_ids = account_obj.search(cr, uid, [('restricted_area', '=', 'register_lines'), ('id', '=', r_account)])
172+ if not restricted_ids and account_code != '10210':
173+ errors.append(_('Line %s. G/L account %s is restricted.') % (current_line_num, account_code,))
174+ continue
175+ account = account_obj.read(cr, uid, r_account, ['type_for_register', 'is_analytic_addicted'], context)
176 type_for_register = account.get('type_for_register', '')
177
178 # cheque_number
179@@ -445,9 +449,7 @@
180 cheque_numbers.append(r_cheque_number)
181 else:
182 errors.append(_('Line %s. Cheque number is missing') % (current_line_num,))
183-
184 # Check that Third party exists (if not empty)
185-
186 tp_label = _('Partner')
187 partner_type = 'partner'
188 third_party_journal_ids = None
189
190=== modified file 'register_accounting/wizard/wizard_register_import.xml'
191--- register_accounting/wizard/wizard_register_import.xml 2014-09-29 09:46:24 +0000
192+++ register_accounting/wizard/wizard_register_import.xml 2014-10-10 10:21:16 +0000
193@@ -63,7 +63,7 @@
194 <th class='account' style='border: thin solid black; border-left: none;'>Account</th>
195 <th class='third_party' style='border: thin solid black; border-left: none;'>Third party</th>
196 <th class='amount_in' style='border: thin solid black; border-left: none;'>Amount IN</th>
197- <th class='amount_out' style='border: thin solid black; border-left: none;'>Amount ON</th>
198+ <th class='amount_out' style='border: thin solid black; border-left: none;'>Amount OUT</th>
199 <th class='destination' style='border: thin solid black; border-left: none;'>Destination</th>
200 <th class='cost_center' style='border: thin solid black; border-left: none;'>Cost Centre</th>
201 <th class='funding_pool' style='border: thin solid black; border-left: none;'>Funding Pool</th>

Subscribers

People subscribed via source and target branches