Merge lp:~savoirfairelinux-openerp/openerp-accountedge/6.1-initial-version into lp:~openerp-accountedge/openerp-accountedge/6.1
- 6.1-initial-version
- Merge into 6.1
Status: | Merged |
---|---|
Merged at revision: | 24 |
Proposed branch: | lp:~savoirfairelinux-openerp/openerp-accountedge/6.1-initial-version |
Merge into: | lp:~openerp-accountedge/openerp-accountedge/6.1 |
Diff against target: | 2686 lines |
To merge this branch: | bzr merge lp:~savoirfairelinux-openerp/openerp-accountedge/6.1-initial-version |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Virgil Dupras (community) | Approve | ||
Joao Alfredo Gama Batista | lgtm. no tests. | Approve | |
Maxime Chambreuil (http://www.savoirfairelinux.com) | code review and tests | Approve | |
OpenERP - AccountEdge | Pending | ||
Review via email: mp+175949@code.launchpad.net |
Commit message
Description of the change
[ADD] Allow OpenERP expense import into AccountEdge
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) : | # |
Joao Alfredo Gama Batista (joao-gama) wrote : | # |
- 8. By Naysan Saran
-
added l10n_ca dependency, changed csv file format
- 9. By Naysan Saran
-
made tax and account fields writable when the expense is approved
- 10. By Naysan Saran
-
resolving diverged branches
- 11. By Naysan Saran
-
added import files
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote : | # |
@joao
I agree with you regarding line 957. This improvement can go in a future version. We use the name (GST or TPS) to match with the right column of the exported file.
FYI, Accountedge accepts only 2 columns : one for GST and HST, one for provincial taxes. HST never has children taxes. So this test is not that bad.
- 12. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[IMP] Cleanup
- 13. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[FIX] format and translate to english
- 14. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[FIX] Set report file extension
- 15. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[IMP] Change export file name
- 16. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[IMP] Cleanup
- 17. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[IMP] Cleanup and copy the header once
- 18. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[REN] renaming module hr_expense_
line_number to hr_expense_ line_sequence - 19. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[FIX] Refactoring code and views
- 20. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[FIX] Conflicting fields between expense and line (name and ref)
- 21. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[FIX] Date format
[UPD] Translation file - 22. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[IMP] Remove 2 columns and change file extension
- 23. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[IMP] Add employee name in the file column
Joao Alfredo Gama Batista (joao-gama) wrote : | # |
@max
Ok
Virgil Dupras (hsoft) wrote : | # |
Not being familiar with the module and not being able to setup a local environment to verify that it actually works, I could only look at the diff and search for code smells. These are my remarks:
- Why not use Python's built-in csv module to produce the tsv in hr_expense_
- There are lines which are commented out. That shouldn't be there.
- In hr_expense_
- Whole templates in PO files: It seems like a weird idea to have our "A new expense has been approved and is ready for export.." HTML templates translated through gettext. Maybe it's the best way we found, but I thought it worthy of mention.
Otherwise, the code looks fine to me.
- 24. By Maxime Chambreuil (http://www.savoirfairelinux.com)
-
[IMP] Explain the comments
Maxime Chambreuil (http://www.savoirfairelinux.com) (max3903) wrote : | # |
Thanks Virgil
I tried to explain the reason of the comments and every template is translated in po files.
Other comments has been copied to this blueprint (no resource available right now):
https:/
debaetsr (rubendebaets) wrote : | # |
Hey,
I guess I found something really useful for you, take a look, you won't regret <http://
ruben
Preview Diff
1 | === added directory 'account_account_halftax' |
2 | === added file 'account_account_halftax/__init__.py' |
3 | --- account_account_halftax/__init__.py 1970-01-01 00:00:00 +0000 |
4 | +++ account_account_halftax/__init__.py 2013-08-12 22:45:40 +0000 |
5 | @@ -0,0 +1,23 @@ |
6 | +# -*- encoding: utf-8 -*- |
7 | +############################################################################## |
8 | +#···· |
9 | +# OpenERP, Open Source Management Solution |
10 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
11 | +# |
12 | +# This program is free software: you can redistribute it and/or modify |
13 | +# it under the terms of the GNU General Public License as |
14 | +# published by the Free Software Foundation, either version 3 of the |
15 | +# License, or (at your option) any later version. |
16 | +# |
17 | +# This program is distributed in the hope that it will be useful, |
18 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20 | +# GNU General Public License for more details. |
21 | +# |
22 | +# You should have received a copy of the GNU General Public License |
23 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
24 | +# |
25 | +############################################################################## |
26 | +import account_account_halftax |
27 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
28 | + |
29 | |
30 | === added file 'account_account_halftax/__openerp__.py' |
31 | --- account_account_halftax/__openerp__.py 1970-01-01 00:00:00 +0000 |
32 | +++ account_account_halftax/__openerp__.py 2013-08-12 22:45:40 +0000 |
33 | @@ -0,0 +1,42 @@ |
34 | +# -*- encoding: utf-8 -*- |
35 | +############################################################################## |
36 | +#···· |
37 | +# OpenERP, Open Source Management Solution |
38 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
39 | +# |
40 | +# This program is free software: you can redistribute it and/or modify |
41 | +# it under the terms of the GNU General Public License as |
42 | +# published by the Free Software Foundation, either version 3 of the |
43 | +# License, or (at your option) any later version. |
44 | +# |
45 | +# This program is distributed in the hope that it will be useful, |
46 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
47 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
48 | +# GNU General Public License for more details. |
49 | +# |
50 | +# You should have received a copy of the GNU General Public License |
51 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
52 | +# |
53 | +############################################################################## |
54 | +{ |
55 | + "name" : "Account tax halftax", |
56 | + "version" : "1.0", |
57 | + "author" : "Savoir-faire Linux", |
58 | + "website" : "http://www.savoirfairelinux.com", |
59 | + "category" : "Human Resources", |
60 | + "description": """ |
61 | + This module adds a boolean to account.account called 'tax_halftax'. |
62 | + If this boolean is set to true, then the amount of the tax has to be |
63 | + divided by 2. |
64 | + """, |
65 | + "depends" : ['account'], |
66 | + "init_xml" : [], |
67 | + "update_xml" : [ |
68 | + 'account_account_halftax.xml', |
69 | + ], |
70 | + "demo_xml" : [], |
71 | + "installable" : True, |
72 | + "certificate" : '' |
73 | +} |
74 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
75 | + |
76 | |
77 | === added file 'account_account_halftax/account_account_halftax.py' |
78 | --- account_account_halftax/account_account_halftax.py 1970-01-01 00:00:00 +0000 |
79 | +++ account_account_halftax/account_account_halftax.py 2013-08-12 22:45:40 +0000 |
80 | @@ -0,0 +1,30 @@ |
81 | +# -*- encoding: utf-8 -*- |
82 | +############################################################################## |
83 | +#···· |
84 | +# OpenERP, Open Source Management Solution |
85 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
86 | +# |
87 | +# This program is free software: you can redistribute it and/or modify |
88 | +# it under the terms of the GNU General Public License as |
89 | +# published by the Free Software Foundation, either version 3 of the |
90 | +# License, or (at your option) any later version. |
91 | +# |
92 | +# This program is distributed in the hope that it will be useful, |
93 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
94 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
95 | +# GNU General Public License for more details. |
96 | +# |
97 | +# You should have received a copy of the GNU General Public License |
98 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
99 | +# |
100 | +############################################################################## |
101 | + |
102 | +from osv import osv, fields |
103 | + |
104 | +class account_account(osv.osv): |
105 | + _inherit = 'account.account' |
106 | + _columns = { |
107 | + 'tax_halftax': fields.boolean('Divide tax by 2'), |
108 | + } |
109 | + |
110 | +account_account() |
111 | |
112 | === added file 'account_account_halftax/account_account_halftax.xml' |
113 | --- account_account_halftax/account_account_halftax.xml 1970-01-01 00:00:00 +0000 |
114 | +++ account_account_halftax/account_account_halftax.xml 2013-08-12 22:45:40 +0000 |
115 | @@ -0,0 +1,16 @@ |
116 | +<?xml version="1.0" encoding="utf-8"?> |
117 | +<openerp> |
118 | + <data> |
119 | + <record id="view_account_form" model="ir.ui.view"> |
120 | + <field name="name">account.account.form</field> |
121 | + <field name="model">account.account</field> |
122 | + <field name="inherit_id" ref="account.view_account_form"/> |
123 | + <field name="arch" type="xml"> |
124 | + <field name="code" position="after"> |
125 | + <field name="tax_halftax"/> |
126 | + </field> |
127 | + </field> |
128 | + </record> |
129 | + </data> |
130 | +</openerp> |
131 | + |
132 | |
133 | === added directory 'account_account_halftax/i18n' |
134 | === added file 'account_account_halftax/i18n/account_account_halftax.pot' |
135 | --- account_account_halftax/i18n/account_account_halftax.pot 1970-01-01 00:00:00 +0000 |
136 | +++ account_account_halftax/i18n/account_account_halftax.pot 2013-08-12 22:45:40 +0000 |
137 | @@ -0,0 +1,49 @@ |
138 | +# Translation of OpenERP Server. |
139 | +# This file contains the translation of the following modules: |
140 | +# * account_account_halftax |
141 | +# |
142 | +msgid "" |
143 | +msgstr "" |
144 | +"Project-Id-Version: OpenERP Server 6.1\n" |
145 | +"Report-Msgid-Bugs-To: \n" |
146 | +"POT-Creation-Date: 2013-07-19 19:35+0000\n" |
147 | +"PO-Revision-Date: 2013-07-19 19:35+0000\n" |
148 | +"Last-Translator: <>\n" |
149 | +"Language-Team: \n" |
150 | +"MIME-Version: 1.0\n" |
151 | +"Content-Type: text/plain; charset=UTF-8\n" |
152 | +"Content-Transfer-Encoding: \n" |
153 | +"Plural-Forms: \n" |
154 | + |
155 | +#. module: account_account_halftax |
156 | +#: model:ir.model,name:account_account_halftax.model_account_account |
157 | +msgid "Account" |
158 | +msgstr "" |
159 | + |
160 | +#. module: account_account_halftax |
161 | +#: constraint:account.account:0 |
162 | +msgid "Error ! You can not create recursive accounts." |
163 | +msgstr "" |
164 | + |
165 | +#. module: account_account_halftax |
166 | +#: field:account.account,tax_halftax:0 |
167 | +msgid "Divide tax by 2" |
168 | +msgstr "" |
169 | + |
170 | +#. module: account_account_halftax |
171 | +#: constraint:account.account:0 |
172 | +msgid "Configuration Error! \n" |
173 | +"You can not select an account type with a deferral method different of \"Unreconciled\" for accounts with internal type \"Payable/Receivable\"! " |
174 | +msgstr "" |
175 | + |
176 | +#. module: account_account_halftax |
177 | +#: sql_constraint:account.account:0 |
178 | +msgid "The code of the account must be unique per company !" |
179 | +msgstr "" |
180 | + |
181 | +#. module: account_account_halftax |
182 | +#: constraint:account.account:0 |
183 | +msgid "Configuration Error! \n" |
184 | +"You can not define children to an account with internal type different of \"View\"! " |
185 | +msgstr "" |
186 | + |
187 | |
188 | === added file 'account_account_halftax/i18n/fr.po' |
189 | --- account_account_halftax/i18n/fr.po 1970-01-01 00:00:00 +0000 |
190 | +++ account_account_halftax/i18n/fr.po 2013-08-12 22:45:40 +0000 |
191 | @@ -0,0 +1,50 @@ |
192 | +# Translation of OpenERP Server. |
193 | +# This file contains the translation of the following modules: |
194 | +# * account_account_halftax |
195 | +# |
196 | +msgid "" |
197 | +msgstr "" |
198 | +"Project-Id-Version: OpenERP Server 6.1\n" |
199 | +"Report-Msgid-Bugs-To: \n" |
200 | +"POT-Creation-Date: 2013-07-19 19:35+0000\n" |
201 | +"PO-Revision-Date: 2013-07-19 19:35+0000\n" |
202 | +"Last-Translator: <>\n" |
203 | +"Language-Team: \n" |
204 | +"MIME-Version: 1.0\n" |
205 | +"Content-Type: text/plain; charset=UTF-8\n" |
206 | +"Content-Transfer-Encoding: \n" |
207 | +"Plural-Forms: \n" |
208 | + |
209 | +#. module: account_account_halftax |
210 | +#: model:ir.model,name:account_account_halftax.model_account_account |
211 | +msgid "Account" |
212 | +msgstr "Compte" |
213 | + |
214 | +#. module: account_account_halftax |
215 | +#: constraint:account.account:0 |
216 | +msgid "Error ! You can not create recursive accounts." |
217 | +msgstr "Erreur! Vous ne pouvez pas créer de comptes récursifs." |
218 | + |
219 | +#. module: account_account_halftax |
220 | +#: field:account.account,tax_halftax:0 |
221 | +msgid "Divide tax by 2" |
222 | +msgstr "Diviser la taxe par 2" |
223 | + |
224 | +#. module: account_account_halftax |
225 | +#: constraint:account.account:0 |
226 | +msgid "Configuration Error! \n" |
227 | +"You can not select an account type with a deferral method different of \"Unreconciled\" for accounts with internal type \"Payable/Receivable\"! " |
228 | +msgstr "" |
229 | + |
230 | +#. module: account_account_halftax |
231 | +#: sql_constraint:account.account:0 |
232 | +msgid "The code of the account must be unique per company !" |
233 | +msgstr "Le code du compte doit être unique par société!" |
234 | + |
235 | +#. module: account_account_halftax |
236 | +#: constraint:account.account:0 |
237 | +msgid "Configuration Error! \n" |
238 | +"You can not define children to an account with internal type different of \"View\"! " |
239 | +msgstr "Erreur de configuration! \n" |
240 | +"Vous ne pouvez pas définir de compte enfant à un compte avec un type différent de \"Vue\"! " |
241 | + |
242 | |
243 | === added directory 'account_tax_accountedge' |
244 | === added file 'account_tax_accountedge/__init__.py' |
245 | --- account_tax_accountedge/__init__.py 1970-01-01 00:00:00 +0000 |
246 | +++ account_tax_accountedge/__init__.py 2013-08-12 22:45:40 +0000 |
247 | @@ -0,0 +1,22 @@ |
248 | +# -*- encoding: utf-8 -*- |
249 | +############################################################################## |
250 | +#···· |
251 | +# OpenERP, Open Source Management Solution |
252 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
253 | +# |
254 | +# This program is free software: you can redistribute it and/or modify |
255 | +# it under the terms of the GNU General Public License as |
256 | +# published by the Free Software Foundation, either version 3 of the |
257 | +# License, or (at your option) any later version. |
258 | +# |
259 | +# This program is distributed in the hope that it will be useful, |
260 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
261 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
262 | +# GNU General Public License for more details. |
263 | +# |
264 | +# You should have received a copy of the GNU General Public License |
265 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
266 | +# |
267 | +############################################################################## |
268 | +import account_tax_accountedge |
269 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
270 | |
271 | === added file 'account_tax_accountedge/__openerp__.py' |
272 | --- account_tax_accountedge/__openerp__.py 1970-01-01 00:00:00 +0000 |
273 | +++ account_tax_accountedge/__openerp__.py 2013-08-12 22:45:40 +0000 |
274 | @@ -0,0 +1,40 @@ |
275 | +# -*- encoding: utf-8 -*- |
276 | +############################################################################## |
277 | +#···· |
278 | +# OpenERP, Open Source Management Solution |
279 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
280 | +# |
281 | +# This program is free software: you can redistribute it and/or modify |
282 | +# it under the terms of the GNU General Public License as |
283 | +# published by the Free Software Foundation, either version 3 of the |
284 | +# License, or (at your option) any later version. |
285 | +# |
286 | +# This program is distributed in the hope that it will be useful, |
287 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
288 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
289 | +# GNU General Public License for more details. |
290 | +# |
291 | +# You should have received a copy of the GNU General Public License |
292 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
293 | +# |
294 | +############################################################################## |
295 | +{ |
296 | + "name" : "AccountEdge tax code", |
297 | + "version" : "1.0", |
298 | + "author" : "Savoir-faire Linux", |
299 | + "website" : "http://www.savoirfairelinux.com", |
300 | + "category" : "Human Resources", |
301 | + "description": """ |
302 | + This module adds the AccountEdge tax code field to account.tax |
303 | + """, |
304 | + "depends" : ['account', 'account_accountant'], |
305 | + "init_xml" : [], |
306 | + "update_xml" : [ |
307 | + 'account_tax_accountedge.xml', |
308 | + ], |
309 | + "demo_xml" : [], |
310 | + "installable" : True, |
311 | + "certificate" : '' |
312 | +} |
313 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
314 | + |
315 | |
316 | === added file 'account_tax_accountedge/account_tax_accountedge.py' |
317 | --- account_tax_accountedge/account_tax_accountedge.py 1970-01-01 00:00:00 +0000 |
318 | +++ account_tax_accountedge/account_tax_accountedge.py 2013-08-12 22:45:40 +0000 |
319 | @@ -0,0 +1,31 @@ |
320 | +# -*- encoding: utf-8 -*- |
321 | +############################################################################## |
322 | +#···· |
323 | +# OpenERP, Open Source Management Solution |
324 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
325 | +# |
326 | +# This program is free software: you can redistribute it and/or modify |
327 | +# it under the terms of the GNU General Public License as |
328 | +# published by the Free Software Foundation, either version 3 of the |
329 | +# License, or (at your option) any later version. |
330 | +# |
331 | +# This program is distributed in the hope that it will be useful, |
332 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
333 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
334 | +# GNU General Public License for more details. |
335 | +# |
336 | +# You should have received a copy of the GNU General Public License |
337 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
338 | +# |
339 | +############################################################################## |
340 | + |
341 | +from osv import osv, fields |
342 | + |
343 | +class account_tax(osv.osv): |
344 | + _inherit = 'account.tax' |
345 | + _columns = { |
346 | + 'tax_code_accountedge': fields.char('Tax code in AccountEdge', size=16, required=False), |
347 | + } |
348 | + |
349 | +account_tax() |
350 | + |
351 | |
352 | === added file 'account_tax_accountedge/account_tax_accountedge.xml' |
353 | --- account_tax_accountedge/account_tax_accountedge.xml 1970-01-01 00:00:00 +0000 |
354 | +++ account_tax_accountedge/account_tax_accountedge.xml 2013-08-12 22:45:40 +0000 |
355 | @@ -0,0 +1,32 @@ |
356 | +<?xml version="1.0" encoding="utf-8"?> |
357 | +<openerp> |
358 | + <data> |
359 | + <record id="view_tax_tree" model="ir.ui.view"> |
360 | + <field name="name">account.tax.tree</field> |
361 | + <field name="model">account.tax</field> |
362 | + <field name="inherit_id" ref="account.view_tax_tree"/> |
363 | + <field name="arch" type="xml"> |
364 | + <field name="description" position="after"> |
365 | + <field name="tax_code_accountedge"/> |
366 | + </field> |
367 | + </field> |
368 | + </record> |
369 | + |
370 | + |
371 | + <record id="view_tax_form" model="ir.ui.view"> |
372 | + <field name="name">account.tax.form</field> |
373 | + <field name="model">account.tax</field> |
374 | + <field name="inherit_id" ref="account.view_tax_form"/> |
375 | + <field name="arch" type="xml"> |
376 | + <field name="description" position="after"> |
377 | + <field name="tax_code_accountedge"/> |
378 | + </field> |
379 | + |
380 | + <tree string="Account Tax" position="replace"> |
381 | + <field name="tax_code_accountedge"/> |
382 | + </tree> |
383 | + </field> |
384 | + </record> |
385 | + |
386 | + </data> |
387 | +</openerp> |
388 | |
389 | === added directory 'account_tax_accountedge/i18n' |
390 | === added file 'account_tax_accountedge/i18n/account_tax_accountedge.pot' |
391 | --- account_tax_accountedge/i18n/account_tax_accountedge.pot 1970-01-01 00:00:00 +0000 |
392 | +++ account_tax_accountedge/i18n/account_tax_accountedge.pot 2013-08-12 22:45:40 +0000 |
393 | @@ -0,0 +1,37 @@ |
394 | +# Translation of OpenERP Server. |
395 | +# This file contains the translation of the following modules: |
396 | +# * account_tax_accountedge |
397 | +# |
398 | +msgid "" |
399 | +msgstr "" |
400 | +"Project-Id-Version: OpenERP Server 6.1\n" |
401 | +"Report-Msgid-Bugs-To: \n" |
402 | +"POT-Creation-Date: 2013-07-19 19:36+0000\n" |
403 | +"PO-Revision-Date: 2013-07-19 19:36+0000\n" |
404 | +"Last-Translator: <>\n" |
405 | +"Language-Team: \n" |
406 | +"MIME-Version: 1.0\n" |
407 | +"Content-Type: text/plain; charset=UTF-8\n" |
408 | +"Content-Transfer-Encoding: \n" |
409 | +"Plural-Forms: \n" |
410 | + |
411 | +#. module: account_tax_accountedge |
412 | +#: sql_constraint:account.tax:0 |
413 | +msgid "Tax Name must be unique per company!" |
414 | +msgstr "" |
415 | + |
416 | +#. module: account_tax_accountedge |
417 | +#: view:account.tax:0 |
418 | +msgid "Account Tax" |
419 | +msgstr "" |
420 | + |
421 | +#. module: account_tax_accountedge |
422 | +#: field:account.tax,tax_code_accountedge:0 |
423 | +msgid "Tax code in AccountEdge" |
424 | +msgstr "" |
425 | + |
426 | +#. module: account_tax_accountedge |
427 | +#: model:ir.model,name:account_tax_accountedge.model_account_tax |
428 | +msgid "account.tax" |
429 | +msgstr "" |
430 | + |
431 | |
432 | === added file 'account_tax_accountedge/i18n/fr.po' |
433 | --- account_tax_accountedge/i18n/fr.po 1970-01-01 00:00:00 +0000 |
434 | +++ account_tax_accountedge/i18n/fr.po 2013-08-12 22:45:40 +0000 |
435 | @@ -0,0 +1,37 @@ |
436 | +# Translation of OpenERP Server. |
437 | +# This file contains the translation of the following modules: |
438 | +# * account_tax_accountedge |
439 | +# |
440 | +msgid "" |
441 | +msgstr "" |
442 | +"Project-Id-Version: OpenERP Server 6.1\n" |
443 | +"Report-Msgid-Bugs-To: \n" |
444 | +"POT-Creation-Date: 2013-07-19 19:36+0000\n" |
445 | +"PO-Revision-Date: 2013-07-19 19:36+0000\n" |
446 | +"Last-Translator: <>\n" |
447 | +"Language-Team: \n" |
448 | +"MIME-Version: 1.0\n" |
449 | +"Content-Type: text/plain; charset=UTF-8\n" |
450 | +"Content-Transfer-Encoding: \n" |
451 | +"Plural-Forms: \n" |
452 | + |
453 | +#. module: account_tax_accountedge |
454 | +#: sql_constraint:account.tax:0 |
455 | +msgid "Tax Name must be unique per company!" |
456 | +msgstr "Le nom de la taxe doit être unique par société!" |
457 | + |
458 | +#. module: account_tax_accountedge |
459 | +#: view:account.tax:0 |
460 | +msgid "Account Tax" |
461 | +msgstr "Compte de taxe" |
462 | + |
463 | +#. module: account_tax_accountedge |
464 | +#: field:account.tax,tax_code_accountedge:0 |
465 | +msgid "Tax code in AccountEdge" |
466 | +msgstr "Code de la taxe dans AccountEdge" |
467 | + |
468 | +#. module: account_tax_accountedge |
469 | +#: model:ir.model,name:account_tax_accountedge.model_account_tax |
470 | +msgid "account.tax" |
471 | +msgstr "account.tax" |
472 | + |
473 | |
474 | === added directory 'hr_employee_accountedge' |
475 | === added file 'hr_employee_accountedge/__init__.py' |
476 | --- hr_employee_accountedge/__init__.py 1970-01-01 00:00:00 +0000 |
477 | +++ hr_employee_accountedge/__init__.py 2013-08-12 22:45:40 +0000 |
478 | @@ -0,0 +1,23 @@ |
479 | +# -*- encoding: utf-8 -*- |
480 | +############################################################################## |
481 | +#···· |
482 | +# OpenERP, Open Source Management Solution |
483 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
484 | +# |
485 | +# This program is free software: you can redistribute it and/or modify |
486 | +# it under the terms of the GNU General Public License as |
487 | +# published by the Free Software Foundation, either version 3 of the |
488 | +# License, or (at your option) any later version. |
489 | +# |
490 | +# This program is distributed in the hope that it will be useful, |
491 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
492 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
493 | +# GNU General Public License for more details. |
494 | +# |
495 | +# You should have received a copy of the GNU General Public License |
496 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
497 | +# |
498 | +############################################################################## |
499 | +import hr_employee_accountedge |
500 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
501 | + |
502 | |
503 | === added file 'hr_employee_accountedge/__openerp__.py' |
504 | --- hr_employee_accountedge/__openerp__.py 1970-01-01 00:00:00 +0000 |
505 | +++ hr_employee_accountedge/__openerp__.py 2013-08-12 22:45:40 +0000 |
506 | @@ -0,0 +1,40 @@ |
507 | +# -*- encoding: utf-8 -*- |
508 | +############################################################################## |
509 | +#···· |
510 | +# OpenERP, Open Source Management Solution |
511 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
512 | +# |
513 | +# This program is free software: you can redistribute it and/or modify |
514 | +# it under the terms of the GNU General Public License as |
515 | +# published by the Free Software Foundation, either version 3 of the |
516 | +# License, or (at your option) any later version. |
517 | +# |
518 | +# This program is distributed in the hope that it will be useful, |
519 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
520 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
521 | +# GNU General Public License for more details. |
522 | +# |
523 | +# You should have received a copy of the GNU General Public License |
524 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
525 | +# |
526 | +############################################################################## |
527 | +{ |
528 | + "name" : "Supplier id on expense line", |
529 | + "version" : "1.0", |
530 | + "author" : "Savoir-faire Linux", |
531 | + "website" : "http://www.savoirfairelinux.com", |
532 | + "category" : "Human Resources", |
533 | + "description": """ |
534 | + This module adds the 'supplier_id_accountedge' field to the |
535 | + hr.employee model. |
536 | + """, |
537 | + "depends" : ['hr_expense'], |
538 | + "init_xml" : [], |
539 | + "update_xml" : [ |
540 | + 'hr_employee_accountedge.xml', |
541 | + ], |
542 | + "demo_xml" : [], |
543 | + "installable" : True, |
544 | + "certificate" : '' |
545 | +} |
546 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
547 | |
548 | === added file 'hr_employee_accountedge/hr_employee_accountedge.py' |
549 | --- hr_employee_accountedge/hr_employee_accountedge.py 1970-01-01 00:00:00 +0000 |
550 | +++ hr_employee_accountedge/hr_employee_accountedge.py 2013-08-12 22:45:40 +0000 |
551 | @@ -0,0 +1,33 @@ |
552 | +# -*- encoding: utf-8 -*- |
553 | +############################################################################## |
554 | +#···· |
555 | +# OpenERP, Open Source Management Solution |
556 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
557 | +# |
558 | +# This program is free software: you can redistribute it and/or modify |
559 | +# it under the terms of the GNU General Public License as |
560 | +# published by the Free Software Foundation, either version 3 of the |
561 | +# License, or (at your option) any later version. |
562 | +# |
563 | +# This program is distributed in the hope that it will be useful, |
564 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
565 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
566 | +# GNU General Public License for more details. |
567 | +# |
568 | +# You should have received a copy of the GNU General Public License |
569 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
570 | +# |
571 | +############################################################################## |
572 | + |
573 | +from osv import fields, osv |
574 | + |
575 | +class hr_employee(osv.osv): |
576 | + _inherit = 'hr.employee' |
577 | + _columns = { |
578 | + 'supplier_id_accountedge': fields.char('Supplier ID in AccountEdge', size=16), |
579 | + } |
580 | + |
581 | +hr_employee() |
582 | + |
583 | + |
584 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
585 | |
586 | === added file 'hr_employee_accountedge/hr_employee_accountedge.xml' |
587 | --- hr_employee_accountedge/hr_employee_accountedge.xml 1970-01-01 00:00:00 +0000 |
588 | +++ hr_employee_accountedge/hr_employee_accountedge.xml 2013-08-12 22:45:40 +0000 |
589 | @@ -0,0 +1,19 @@ |
590 | +<?xml version="1.0" encoding="utf-8"?> |
591 | +<openerp> |
592 | + <data> |
593 | + <record id="view_employee_form" model="ir.ui.view"> |
594 | + <field name="name">hr.employee.form</field> |
595 | + <field name="model">hr.employee</field> |
596 | + <field name="inherit_id" ref="hr.view_employee_form"/> |
597 | + <field name="arch" type="xml"> |
598 | + <form string="Employee"> |
599 | + <notebook> |
600 | + <page string="Harmonization with AccountEdge"> |
601 | + <field name="supplier_id_accountedge"/> |
602 | + </page> |
603 | + </notebook> |
604 | + </form> |
605 | + </field> |
606 | + </record> |
607 | + </data> |
608 | +</openerp> |
609 | |
610 | === added directory 'hr_employee_accountedge/i18n' |
611 | === added file 'hr_employee_accountedge/i18n/fr.po' |
612 | --- hr_employee_accountedge/i18n/fr.po 1970-01-01 00:00:00 +0000 |
613 | +++ hr_employee_accountedge/i18n/fr.po 2013-08-12 22:45:40 +0000 |
614 | @@ -0,0 +1,38 @@ |
615 | +# Translation of OpenERP Server. |
616 | +# This file contains the translation of the following modules: |
617 | +# * hr_employee_accountedge |
618 | +# |
619 | +msgid "" |
620 | +msgstr "" |
621 | +"Project-Id-Version: OpenERP Server 6.1\n" |
622 | +"Report-Msgid-Bugs-To: \n" |
623 | +"POT-Creation-Date: 2013-07-19 19:37+0000\n" |
624 | +"PO-Revision-Date: 2013-07-19 19:37+0000\n" |
625 | +"Last-Translator: <>\n" |
626 | +"Language-Team: \n" |
627 | +"MIME-Version: 1.0\n" |
628 | +"Content-Type: text/plain; charset=UTF-8\n" |
629 | +"Content-Transfer-Encoding: \n" |
630 | +"Plural-Forms: \n" |
631 | + |
632 | +#. module: hr_employee_accountedge |
633 | +#: view:hr.employee:0 |
634 | +#: model:ir.model,name:hr_employee_accountedge.model_hr_employee |
635 | +msgid "Employee" |
636 | +msgstr "Employé" |
637 | + |
638 | +#. module: hr_employee_accountedge |
639 | +#: view:hr.employee:0 |
640 | +msgid "Harmonization with AccountEdge" |
641 | +msgstr "Harmonisation avec AccountEdge" |
642 | + |
643 | +#. module: hr_employee_accountedge |
644 | +#: field:hr.employee,supplier_id_accountedge:0 |
645 | +msgid "Supplier ID in AccountEdge" |
646 | +msgstr "Identifiant du fournisseur dans AccountEdge" |
647 | + |
648 | +#. module: hr_employee_accountedge |
649 | +#: constraint:hr.employee:0 |
650 | +msgid "Error ! You cannot create recursive Hierarchy of Employees." |
651 | +msgstr "Erreur! Vous ne pouvez pas créer de hiérarchie récursive des employés." |
652 | + |
653 | |
654 | === added file 'hr_employee_accountedge/i18n/hr_employee_accountedge.pot' |
655 | --- hr_employee_accountedge/i18n/hr_employee_accountedge.pot 1970-01-01 00:00:00 +0000 |
656 | +++ hr_employee_accountedge/i18n/hr_employee_accountedge.pot 2013-08-12 22:45:40 +0000 |
657 | @@ -0,0 +1,38 @@ |
658 | +# Translation of OpenERP Server. |
659 | +# This file contains the translation of the following modules: |
660 | +# * hr_employee_accountedge |
661 | +# |
662 | +msgid "" |
663 | +msgstr "" |
664 | +"Project-Id-Version: OpenERP Server 6.1\n" |
665 | +"Report-Msgid-Bugs-To: \n" |
666 | +"POT-Creation-Date: 2013-07-19 19:37+0000\n" |
667 | +"PO-Revision-Date: 2013-07-19 19:37+0000\n" |
668 | +"Last-Translator: <>\n" |
669 | +"Language-Team: \n" |
670 | +"MIME-Version: 1.0\n" |
671 | +"Content-Type: text/plain; charset=UTF-8\n" |
672 | +"Content-Transfer-Encoding: \n" |
673 | +"Plural-Forms: \n" |
674 | + |
675 | +#. module: hr_employee_accountedge |
676 | +#: view:hr.employee:0 |
677 | +#: model:ir.model,name:hr_employee_accountedge.model_hr_employee |
678 | +msgid "Employee" |
679 | +msgstr "" |
680 | + |
681 | +#. module: hr_employee_accountedge |
682 | +#: view:hr.employee:0 |
683 | +msgid "Harmonization with AccountEdge" |
684 | +msgstr "" |
685 | + |
686 | +#. module: hr_employee_accountedge |
687 | +#: field:hr.employee,supplier_id_accountedge:0 |
688 | +msgid "Supplier ID in AccountEdge" |
689 | +msgstr "" |
690 | + |
691 | +#. module: hr_employee_accountedge |
692 | +#: constraint:hr.employee:0 |
693 | +msgid "Error ! You cannot create recursive Hierarchy of Employees." |
694 | +msgstr "" |
695 | + |
696 | |
697 | === added directory 'hr_expense_accountedge' |
698 | === added file 'hr_expense_accountedge/__init__.py' |
699 | --- hr_expense_accountedge/__init__.py 1970-01-01 00:00:00 +0000 |
700 | +++ hr_expense_accountedge/__init__.py 2013-08-12 22:45:40 +0000 |
701 | @@ -0,0 +1,23 @@ |
702 | +# -*- encoding: utf-8 -*- |
703 | +############################################################################## |
704 | +#···· |
705 | +# OpenERP, Open Source Management Solution |
706 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
707 | +# |
708 | +# This program is free software: you can redistribute it and/or modify |
709 | +# it under the terms of the GNU General Public License as |
710 | +# published by the Free Software Foundation, either version 3 of the |
711 | +# License, or (at your option) any later version. |
712 | +# |
713 | +# This program is distributed in the hope that it will be useful, |
714 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
715 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
716 | +# GNU General Public License for more details. |
717 | +# |
718 | +# You should have received a copy of the GNU General Public License |
719 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
720 | +# |
721 | +############################################################################## |
722 | +import hr_expense_accountedge |
723 | +import edi |
724 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
725 | |
726 | === added file 'hr_expense_accountedge/__openerp__.py' |
727 | --- hr_expense_accountedge/__openerp__.py 1970-01-01 00:00:00 +0000 |
728 | +++ hr_expense_accountedge/__openerp__.py 2013-08-12 22:45:40 +0000 |
729 | @@ -0,0 +1,52 @@ |
730 | +# -*- encoding: utf-8 -*- |
731 | +############################################################################## |
732 | +#···· |
733 | +# OpenERP, Open Source Management Solution |
734 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
735 | +# |
736 | +# This program is free software: you can redistribute it and/or modify |
737 | +# it under the terms of the GNU General Public License as |
738 | +# published by the Free Software Foundation, either version 3 of the |
739 | +# License, or (at your option) any later version. |
740 | +# |
741 | +# This program is distributed in the hope that it will be useful, |
742 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
743 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
744 | +# GNU General Public License for more details. |
745 | +# |
746 | +# You should have received a copy of the GNU General Public License |
747 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
748 | +# |
749 | +############################################################################## |
750 | +{ |
751 | + "name" : "Harmonization of expenses with AccountEdge", |
752 | + "version" : "1.0", |
753 | + "author" : "Savoir-faire Linux", |
754 | + "website" : "http://www.savoirfairelinux.com", |
755 | + "category" : "Human Resources", |
756 | + "description": """ |
757 | + This module generates the csv reports for the exportation |
758 | + of expenses in AccountEdge. |
759 | + It also modifies the workflow of the expenses. |
760 | + """, |
761 | + "depends" : [ |
762 | + 'l10n_ca', |
763 | + 'hr_employee_accountedge', |
764 | + 'hr_expense_line_supplier', |
765 | + 'hr_expense_line_supplier_tax', |
766 | + 'hr_expense_line_account', |
767 | + 'hr_expense_line_sequence', |
768 | + 'account_account_halftax', |
769 | + 'account_tax_accountedge' |
770 | + ], |
771 | + "init_xml" : [], |
772 | + "update_xml" : [ |
773 | + 'hr_expense_accountedge.xml', |
774 | + 'security/ir_rule.xml', |
775 | + ], |
776 | + "demo_xml" : [], |
777 | + "installable" : True, |
778 | + "certificate" : '' |
779 | +} |
780 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
781 | + |
782 | |
783 | === added directory 'hr_expense_accountedge/edi' |
784 | === added file 'hr_expense_accountedge/edi/__init__.py' |
785 | --- hr_expense_accountedge/edi/__init__.py 1970-01-01 00:00:00 +0000 |
786 | +++ hr_expense_accountedge/edi/__init__.py 2013-08-12 22:45:40 +0000 |
787 | @@ -0,0 +1,25 @@ |
788 | +# -*- coding: utf-8 -*- |
789 | +############################################################################## |
790 | +# |
791 | +# OpenERP, Open Source Business Applications |
792 | +# Copyright (c) 2011 OpenERP S.A. <http://openerp.com> |
793 | +# |
794 | +# This program is free software: you can redistribute it and/or modify |
795 | +# it under the terms of the GNU Affero General Public License as |
796 | +# published by the Free Software Foundation, either version 3 of the |
797 | +# License, or (at your option) any later version. |
798 | +# |
799 | +# This program is distributed in the hope that it will be useful, |
800 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
801 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
802 | +# GNU Affero General Public License for more details. |
803 | +# |
804 | +# You should have received a copy of the GNU Affero General Public License |
805 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
806 | +# |
807 | +############################################################################## |
808 | + |
809 | +import hr_expense_expense |
810 | + |
811 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
812 | + |
813 | |
814 | === added file 'hr_expense_accountedge/edi/hr_expense_expense.py' |
815 | --- hr_expense_accountedge/edi/hr_expense_expense.py 1970-01-01 00:00:00 +0000 |
816 | +++ hr_expense_accountedge/edi/hr_expense_expense.py 2013-08-12 22:45:40 +0000 |
817 | @@ -0,0 +1,49 @@ |
818 | +# -*- coding: utf-8 -*- |
819 | +############################################################################## |
820 | +# |
821 | +# OpenERP, Open Source Business Applications |
822 | +# Copyright (c) 2011 OpenERP S.A. <http://openerp.com> |
823 | +# |
824 | +# This program is free software: you can redistribute it and/or modify |
825 | +# it under the terms of the GNU Affero General Public License as |
826 | +# published by the Free Software Foundation, either version 3 of the |
827 | +# License, or (at your option) any later version. |
828 | +# |
829 | +# This program is distributed in the hope that it will be useful, |
830 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
831 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
832 | +# GNU Affero General Public License for more details. |
833 | +# |
834 | +# You should have received a copy of the GNU Affero General Public License |
835 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
836 | +# |
837 | +############################################################################## |
838 | + |
839 | +from osv import fields, osv, orm |
840 | +from edi import EDIMixin |
841 | + |
842 | +class hr_expense_expense(osv.osv, EDIMixin): |
843 | + _inherit = 'hr.expense.expense' |
844 | + |
845 | + def _edi_get_web_url_view(self, cr, uid, ids, field_name, arg, context): |
846 | + res = {} |
847 | + |
848 | + for id in ids: |
849 | + web_root_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url') |
850 | + res[id] = "%s/web/webclient/home#id=%s&view_type=page&model=hr.expense.expense" % (web_root_url, id) |
851 | + |
852 | + return res |
853 | + |
854 | + _columns = { |
855 | + 'web_url_view' : fields.function( |
856 | + _edi_get_web_url_view, |
857 | + string='Url of the expense view', |
858 | + type='char', |
859 | + size=255, |
860 | + readonly=True), |
861 | + } |
862 | + |
863 | + |
864 | + |
865 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
866 | + |
867 | |
868 | === added file 'hr_expense_accountedge/hr_expense_accountedge.py' |
869 | --- hr_expense_accountedge/hr_expense_accountedge.py 1970-01-01 00:00:00 +0000 |
870 | +++ hr_expense_accountedge/hr_expense_accountedge.py 2013-08-12 22:45:40 +0000 |
871 | @@ -0,0 +1,211 @@ |
872 | +# -*- encoding: utf-8 -*- |
873 | +############################################################################## |
874 | +#···· |
875 | +# OpenERP, Open Source Management Solution |
876 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
877 | +# |
878 | +# This program is free software: you can redistribute it and/or modify |
879 | +# it under the terms of the GNU General Public License as |
880 | +# published by the Free Software Foundation, either version 3 of the |
881 | +# License, or (at your option) any later version. |
882 | +# |
883 | +# This program is distributed in the hope that it will be useful, |
884 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
885 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
886 | +# GNU General Public License for more details. |
887 | +# |
888 | +# You should have received a copy of the GNU General Public License |
889 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
890 | +# |
891 | +############################################################################## |
892 | + |
893 | +import time |
894 | +import base64 |
895 | + |
896 | +from osv import osv, fields |
897 | +from datetime import datetime |
898 | + |
899 | + |
900 | +class hr_expense_expense(osv.osv): |
901 | + _inherit = 'hr.expense.expense' |
902 | + |
903 | + def _create_csv_report(self,cr,uid,ids,context={}): |
904 | + res = {} |
905 | + for id in ids: |
906 | + this = self.browse(cr, uid, id) |
907 | + empl_id = self.pool.get('hr.employee').search(cr, uid, [('user_id','=', this.user_id.id)]) |
908 | + empl = self.pool.get('hr.employee').browse(cr, uid, empl_id)[0] |
909 | + |
910 | + output = this.employee_id.name |
911 | + output += "\r\n" |
912 | + output += "Employee\tCard ID\tDate\tVendor Invoice #\tAccount Number\tAmount\tDescription\ |
913 | + \tTax Code\tCurrency Code\tExchange Rate\r\n" |
914 | + # Comment the previous line and uncomment the next one |
915 | + # if you want to import taxes with their amount, instead of their code |
916 | + # \tTax Code\tGST Amount\tPST/QST Amount\tCurrency Code\tExchange Rate\r\n" |
917 | + |
918 | + |
919 | + for l in this.line_ids: |
920 | + taxes = self._compute_taxes(cr,uid,l,context) |
921 | + #output += u"%s\t%s\t%s\t%s\t%s\t%.2f\t%s\t%s\t%.2f\t%.2f\t%s\t%.2f\r\n" % ( |
922 | + output += u"%s\t%s\t%s\t%s\t%s\t%.2f\t%s\t%s\t%s\t%.2f\r\n" % ( |
923 | + this.employee_id.name, |
924 | + this.employee_id.supplier_id_accountedge, |
925 | + datetime.strptime(l.date_value,"%Y-%m-%d").strftime("%d-%m-%Y"), |
926 | + l.expense_id.id, |
927 | + l.account_id.code, |
928 | + taxes['amount_before_tax'], |
929 | + l.name, |
930 | + (l.tax_id.tax_code_accountedge or '000'), |
931 | + # Comment the previous line and uncomment the next two ones |
932 | + # if you want to import taxes with their amount, instead of their code |
933 | + # taxes['amount_gst'], |
934 | + # taxes['amount_pst'], |
935 | + (l.expense_id.currency_id.name or 'CAD'), |
936 | + (float(l.expense_id.currency_id.rate) or '1.0')) |
937 | + |
938 | + byte_string = output.encode('utf-8-sig') |
939 | + res[id] = base64.encodestring(byte_string) |
940 | + |
941 | + self.write(cr, uid, ids, {'csv_file':res[id]}, context=context) |
942 | + self._add_attachment(cr,uid,id,byte_string,context) |
943 | + |
944 | + return True |
945 | + |
946 | + |
947 | + def _compute_taxes(self,cr,uid,expense_line,context={}): |
948 | + |
949 | + res = { |
950 | + 'amount_before_tax' : expense_line.total_amount, |
951 | + 'amount_gst' : 0.0, # Goods and Services Tax, federal |
952 | + 'amount_pst' : 0.0 # Provincial Sales Tax |
953 | + } |
954 | + |
955 | + tax = expense_line.tax_id |
956 | + if not tax.amount: |
957 | + return res |
958 | + |
959 | + # Divide tax per two? |
960 | + tax_factor = 1.0 |
961 | + if expense_line.account_id.tax_halftax: |
962 | + tax_factor = 0.5 |
963 | + |
964 | + if tax.child_ids : |
965 | + for child_tax in tax.child_ids: # TODO: the detection of the two taxes should be more reliable |
966 | + if 'TPS' in child_tax.name or 'GST' in child_tax.name: |
967 | + res['amount_gst'] = float(child_tax.amount) * tax_factor |
968 | + else: |
969 | + res['amount_pst'] = float(child_tax.amount) * tax_factor |
970 | + else: |
971 | + res['amount_gst'] = float(tax.amount) |
972 | + |
973 | + |
974 | + res['amount_before_tax'] = expense_line.total_amount / (1 + res['amount_gst'] + res['amount_pst']) |
975 | + res['amount_gst'] = res['amount_before_tax'] * res['amount_gst'] |
976 | + res['amount_pst'] = res['amount_before_tax'] * res['amount_pst'] |
977 | + |
978 | + return res |
979 | + |
980 | + |
981 | + |
982 | + def _add_attachment(self,cr,uid,ids,content,context={}): |
983 | + |
984 | + file_name = 'export_'+time.strftime('%Y%m%d_%H%M%S')+'.tsv' |
985 | + attach_id = self.pool.get('ir.attachment').create(cr, uid, { |
986 | + 'name' : file_name, |
987 | + 'datas' : base64.encodestring(content), |
988 | + 'datas_fname' : file_name, |
989 | + 'res_model' : self._name, |
990 | + 'res_id' : ids, |
991 | + }, |
992 | + context=context |
993 | + ) |
994 | + return True |
995 | + |
996 | + def action_exported(self,cr,uid,ids,*args): |
997 | + if not len(ids): |
998 | + return False |
999 | + |
1000 | + # Employee must have a recordID matching his supplier account |
1001 | + # in Accountedge to generate an expense sheet |
1002 | + for id in ids: |
1003 | + this = self.browse(cr, uid, id) |
1004 | + if not this.employee_id.supplier_id_accountedge: |
1005 | + raise osv.except_osv('Accountedge Supplier ID missing', |
1006 | + 'Please add the Accountedge supplier ID on the employee before exporting the sheet.') |
1007 | + |
1008 | + self._create_csv_report(cr,uid,ids,{}) |
1009 | + self.write(cr,uid,ids,{'state': 'exported'}) |
1010 | + |
1011 | + return True |
1012 | + |
1013 | + |
1014 | + def action_imported(self,cr,uid,ids,*args): |
1015 | + if not len(ids): |
1016 | + return False |
1017 | + for id in ids: |
1018 | + self.write(cr,uid,ids,{'state': 'imported'}) |
1019 | + return True |
1020 | + |
1021 | + |
1022 | + def _get_cur_account_manager(self, cr, uid, ids, field_name, arg, context): |
1023 | + res = {} |
1024 | + for id in ids: |
1025 | + emails = '' |
1026 | + grp_ids = self.pool.get('res.groups').search(cr, uid, [('name','=',u'Manager'),('category_id.name','=',u'Accounting & Finance')]) |
1027 | + usr_ids = self.pool.get('res.users').search(cr, uid, [('groups_id','=',grp_ids[0])]) |
1028 | + usrs = self.pool.get('res.users').browse(cr, uid, usr_ids) |
1029 | + |
1030 | + for user in usrs: |
1031 | + if user.user_email: |
1032 | + emails += user.user_email |
1033 | + emails += ',' |
1034 | + else: |
1035 | + empl_id = self.pool.get('hr.employee').search(cr, uid,[('login','=',user.login)])[0] |
1036 | + empl = self.pool.get('hr.employee').browse(cr, uid, empl_id) |
1037 | + if empl.work_email: |
1038 | + emails += empl.work_email |
1039 | + emails += ',' |
1040 | + |
1041 | + emails = emails[:-1] |
1042 | + res[id] = emails |
1043 | + return res |
1044 | + |
1045 | + _columns = { |
1046 | + 'manager' : fields.function(_get_cur_account_manager,string='Manager',type='char',size=128,readonly=True), |
1047 | + 'state' : fields.selection([ |
1048 | + ('draft', 'New'), |
1049 | + ('confirm', 'Waiting Approval'), |
1050 | + ('accepted', 'Approved'), |
1051 | + ('exported', 'Exported'), |
1052 | + ('imported', 'Imported'), |
1053 | + ('cancelled', 'Refused'),], |
1054 | + 'State', readonly=True, help='When the expense request is created the state is \'Draft\'.\ |
1055 | + \n It is confirmed by the user and request is sent to admin, the state is \'Waiting Confirmation\'.\ |
1056 | + \nIf the admin accepts it, the state is \'Accepted\'.\ |
1057 | + \nIf the admin refuses it, the state is \'Refused\'.\ |
1058 | + \n If a csv file has been generated for the expense request, the state is \'Exported\'.\ |
1059 | + \n If the expense request has been imported in AccountEdge, the state is \'Imported\'.' |
1060 | + ), |
1061 | + } |
1062 | + |
1063 | + |
1064 | +hr_expense_expense() |
1065 | + |
1066 | +class hr_expense_line(osv.osv): |
1067 | + _inherit = 'hr.expense.line' |
1068 | + |
1069 | + def _get_parent_state(self, cr, uid, ids, field_name, arg, context): |
1070 | + res = {} |
1071 | + for id in ids: |
1072 | + expense_line = self.pool.get('hr.expense.line').browse(cr, uid, id) |
1073 | + res[id] = expense_line.expense_id.state |
1074 | + return res |
1075 | + |
1076 | + _columns = { |
1077 | + 'state': fields.function(_get_parent_state,string='Expense State',type='char',size=128,readonly=True), |
1078 | + } |
1079 | + |
1080 | +hr_expense_line() |
1081 | + |
1082 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1083 | |
1084 | === added file 'hr_expense_accountedge/hr_expense_accountedge.xml' |
1085 | --- hr_expense_accountedge/hr_expense_accountedge.xml 1970-01-01 00:00:00 +0000 |
1086 | +++ hr_expense_accountedge/hr_expense_accountedge.xml 2013-08-12 22:45:40 +0000 |
1087 | @@ -0,0 +1,284 @@ |
1088 | +<?xml version="1.0" encoding="utf-8"?> |
1089 | +<openerp> |
1090 | + <data> |
1091 | + <!-- EDI Export + Send email Action --> |
1092 | + <record id="ir_actions_server_edi_expense_approved" model="ir.actions.server"> |
1093 | + <field name="code">object.edi_export_and_email(template_ext_id='hr_expense_accountedge.email_template_edi_expense_accepted', context=context)</field> |
1094 | + <field eval="6" name="sequence"/> |
1095 | + <field name="state">code</field> |
1096 | + <field name="type">ir.actions.server</field> |
1097 | + <field name="model_id" ref="model_hr_expense_expense"/> |
1098 | + <field name="condition">True</field> |
1099 | + <field name="name">Auto-email expense approved</field> |
1100 | + </record> |
1101 | + |
1102 | + <record id="ir_actions_server_edi_expense_confirm" model="ir.actions.server"> |
1103 | + <field name="code">object.edi_export_and_email(template_ext_id='hr_expense_accountedge.email_template_edi_expense_waiting_approval', context=context)</field> |
1104 | + <field eval="6" name="sequence"/> |
1105 | + <field name="state">code</field> |
1106 | + <field name="type">ir.actions.server</field> |
1107 | + <field name="model_id" ref="model_hr_expense_expense"/> |
1108 | + <field name="condition">True</field> |
1109 | + <field name="name">Auto-email expense waiting for approval</field> |
1110 | + </record> |
1111 | + |
1112 | + |
1113 | + <!-- EDI related Email Templates menu (HR -> Configuration -> Email Templates) --> |
1114 | + <record model="ir.actions.act_window" id="action_email_templates_expenses"> |
1115 | + <field name="name">Email Templates</field> |
1116 | + <field name="res_model">email.template</field> |
1117 | + <field name="view_type">form</field> |
1118 | + <field name="view_mode">form,tree</field> |
1119 | + <field name="view_id" ref="email_template.email_template_tree" /> |
1120 | + <field name="search_view_id" ref="email_template.view_email_template_search"/> |
1121 | + <field name="context">{'search_default_model_id':'hr.expense.expense'}</field> |
1122 | + <field name="context" eval="{'search_default_model_id': ref('model_hr_expense_expense')}"/> |
1123 | + </record> |
1124 | + <menuitem id="menu_email_templates_expenses" parent="hr.menu_hr_configuration" action="action_email_templates_expenses" sequence="30"/> |
1125 | + |
1126 | + <!-- |
1127 | + Expenses and Expense Lines |
1128 | + --> |
1129 | + |
1130 | + <record id="view_expenses_form_line" model="ir.ui.view"> |
1131 | + <field name="name">hr.expense.form</field> |
1132 | + <field name="type">form</field> |
1133 | + <field name="model">hr.expense.expense</field> |
1134 | + <field name="inherit_id" ref="hr_expense.view_expenses_form"/> |
1135 | + <field name="arch" type="xml"> |
1136 | + <field name="state" position="replace"> |
1137 | + <field name="state" widget="statusbar" statusbar_visible="draft,confirm,accepted,exported,imported" statusbar_colors='{"confirm":"blue","cancelled":"red"}'/> |
1138 | + </field> |
1139 | + |
1140 | + <field name="product_id" position="before"> |
1141 | + <field name="state" invisible="1"/> |
1142 | + </field> |
1143 | + |
1144 | + <field name="line_ids" position="attributes"> |
1145 | + <attribute name="attrs">{'readonly':[('state','in',['confirm','cancelled','exported','imported'])]}</attribute> |
1146 | + </field> |
1147 | + |
1148 | + <group col="6" colspan="2" position="replace"> |
1149 | + <group col="6" colspan="2"> |
1150 | + <button name="draft" states="confirm,cancelled,exported" string="Set to Draft" type="workflow" icon="gtk-convert" groups="base.group_hr_user"/> |
1151 | + <button name="refuse" states="confirm,accepted" string="Refuse" type="workflow" icon="gtk-no" groups="base.group_hr_user" /> |
1152 | + <button name="confirm" states="draft" string="Submit to Manager" type="workflow" icon="gtk-apply"/> |
1153 | + <button name="validate" states="confirm" string="Approve" type="workflow" icon="gtk-go-forward" groups="base.group_hr_user"/> |
1154 | + <button name="action_exported" states="accepted" string="Export CSV" type="workflow" groups="account.group_account_manager,account.group_account_invoice"/> |
1155 | + <button name="action_imported" states="exported" confirm="This action cannot be undone" string="Mark as imported" type="workflow" groups="account.group_account_manager,account.group_account_invoice"/> |
1156 | + </group> |
1157 | + </group> |
1158 | + |
1159 | + <field name="product_id" position="attributes"> |
1160 | + <attribute name="attrs">{'readonly':[('state','in',['confirm','accepted','cancelled','exported','imported'])]}</attribute> |
1161 | + </field> |
1162 | + |
1163 | + <field name="unit_amount" position="attributes"> |
1164 | + <attribute name="attrs">{'readonly':[('state','in',['confirm','accepted','cancelled','exported','imported'])]}</attribute> |
1165 | + </field> |
1166 | + |
1167 | + <field name="unit_quantity" position="attributes"> |
1168 | + <attribute name="attrs">{'readonly':[('state','in',['confirm','accepted','cancelled','exported','imported'])]}</attribute> |
1169 | + </field> |
1170 | + |
1171 | + <field name="uom_id" position="attributes"> |
1172 | + <attribute name="attrs">{'readonly':[('state','in',['confirm','accepted','cancelled','exported','imported'])]}</attribute> |
1173 | + </field> |
1174 | + |
1175 | + <field name="date_value" position="attributes"> |
1176 | + <attribute name="attrs">{'readonly':[('state','in',['confirm','accepted','cancelled','exported','imported'])]}</attribute> |
1177 | + </field> |
1178 | + |
1179 | + <field name="analytic_account" position="attributes"> |
1180 | + <attribute name="attrs">{'readonly':[('state','in',['confirm','accepted','cancelled','exported','imported'])]}</attribute> |
1181 | + </field> |
1182 | + |
1183 | + <xpath expr="//page/field/form/group/field[@name='ref']" position="attributes"> |
1184 | + <attribute name="attrs">{'readonly':[('state','in',['confirm','accepted','cancelled','exported','imported'])]}</attribute> |
1185 | + </xpath> |
1186 | + |
1187 | + <xpath expr="//page/field/form/group/field[@name='name']" position="attributes"> |
1188 | + <attribute name="attrs">{'readonly':[('state','in',['confirm','accepted','cancelled','exported','imported'])]}</attribute> |
1189 | + </xpath> |
1190 | + |
1191 | + </field> |
1192 | + </record> |
1193 | + |
1194 | + <record id="view_expenses_form_partner" model="ir.ui.view"> |
1195 | + <field name="name">hr.expense.form</field> |
1196 | + <field name="type">form</field> |
1197 | + <field name="model">hr.expense.expense</field> |
1198 | + <field name="inherit_id" ref="hr_expense_line_supplier_tax.view_expenses_form"/> |
1199 | + <field name="arch" type="xml"> |
1200 | + <field name="partner_id" position="attributes"> |
1201 | + <attribute name="attrs">{'readonly':[('state','in',['confirm','accepted','cancelled','exported','imported'])]}</attribute> |
1202 | + </field> |
1203 | + |
1204 | + <field name="tax_id" position="attributes"> |
1205 | + <attribute name="groups">account.group_account_invoice</attribute> |
1206 | + <attribute name="attrs">{'readonly':[('state','in',['confirm','cancelled','exported','imported'])]}</attribute> |
1207 | + </field> |
1208 | + |
1209 | + </field> |
1210 | + </record> |
1211 | + |
1212 | + <record id="view_expenses_form_account" model="ir.ui.view"> |
1213 | + <field name="name">hr.expense.form</field> |
1214 | + <field name="type">form</field> |
1215 | + <field name="model">hr.expense.expense</field> |
1216 | + <field name="inherit_id" ref="hr_expense_line_account.view_expenses_form"/> |
1217 | + <field name="arch" type="xml"> |
1218 | + <field name="account_id" position="attributes"> |
1219 | + <attribute name="groups">account.group_account_invoice</attribute> |
1220 | + <attribute name="attrs">{'readonly':[('state','in',['confirm','cancelled','exported','imported'])]}</attribute> |
1221 | + </field> |
1222 | + |
1223 | + </field> |
1224 | + </record> |
1225 | + |
1226 | + </data> |
1227 | + |
1228 | + <data noupdate="1"> |
1229 | + <!-- |
1230 | + Workflow definition |
1231 | + --> |
1232 | + |
1233 | + <record id="hr_expense.act_confirm" model="workflow.activity"> |
1234 | + <field name="action_id" ref="ir_actions_server_edi_expense_confirm"/> |
1235 | + </record> |
1236 | + |
1237 | + <record id="hr_expense.act_accepted" model="workflow.activity"> |
1238 | + <field name="action_id" ref="ir_actions_server_edi_expense_approved"/> |
1239 | + </record> |
1240 | + |
1241 | + <record id="hr_expense.act_exported" model="workflow.activity"> |
1242 | + <field name="wkf_id" ref="hr_expense.wkf_expenses"/> |
1243 | + <field name="name">exported</field> |
1244 | + <field name="kind">function</field> |
1245 | + <field name="action">action_exported()</field> |
1246 | + </record> |
1247 | + |
1248 | + <record id="hr_expense.act_imported" model="workflow.activity"> |
1249 | + <field name="wkf_id" ref="hr_expense.wkf_expenses"/> |
1250 | + <field name="name">imported</field> |
1251 | + <field name="kind">function</field> |
1252 | + <field name="action">action_imported()</field> |
1253 | + </record> |
1254 | + |
1255 | + |
1256 | + <record id="t_wait_accepted_to_exported" model="workflow.transition"> |
1257 | + <field name="act_from" ref="hr_expense.act_accepted"/> |
1258 | + <field name="act_to" ref="hr_expense.act_exported"/> |
1259 | + <field name="signal">action_exported</field> |
1260 | + <field name="group_id" ref="base.group_hr_user"/> |
1261 | + </record> |
1262 | + |
1263 | + <record id="t_exported_to_draft" model="workflow.transition"> |
1264 | + <field name="act_from" ref="hr_expense.act_exported"/> |
1265 | + <field name="act_to" ref="hr_expense.act_draft"/> |
1266 | + <field name="signal">draft</field> |
1267 | + <field name="group_id" ref="base.group_hr_user"/> |
1268 | + </record> |
1269 | + |
1270 | + <record id="t_exported_to_imported" model="workflow.transition"> |
1271 | + <field name="act_from" ref="hr_expense.act_exported"/> |
1272 | + <field name="act_to" ref="hr_expense.act_imported"/> |
1273 | + <field name="signal">action_imported</field> |
1274 | + <field name="group_id" ref="base.group_hr_user"/> |
1275 | + </record> |
1276 | + |
1277 | + |
1278 | + |
1279 | + <!-- |
1280 | + Email template for expenses that are waiting for approval |
1281 | + --> |
1282 | + <record id="email_template_edi_expense_waiting_approval" model="email.template"> |
1283 | + <field name="name">Automated Invoice Notification Mail</field> |
1284 | + <field name="email_from">${object.company_id.email or 'noreply@localhost'}</field> |
1285 | + <field name="subject">New expense waiting for approval</field> |
1286 | + <field name="email_to">${object.employee_id.parent_id.work_email or 'naysan.saran@gmail.com'}</field> |
1287 | + <field name="model_id" ref="model_hr_expense_expense"/> |
1288 | + <field name="auto_delete" eval="True"/> |
1289 | + <field name="lang">${object.employee_id.partner_id.lang}</field> |
1290 | + <field name="body_html"><![CDATA[ |
1291 | + <div style=" |
1292 | + font-family : 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; |
1293 | + font-size : 12px; |
1294 | + color : rgb(34, 34, 34); |
1295 | + background-color: #FFF; |
1296 | + "> |
1297 | + |
1298 | + <p>Hello,</p> |
1299 | + <p>A new expense is waiting for approval. </p> |
1300 | + <p>You can view the expense using the following link: </p> |
1301 | + <a style=" |
1302 | + display:block; width: 150px; height:20px; |
1303 | + margin-left: 20px; color: #DDD; |
1304 | + font-family: 'Lucida Grande', Helvetica, Arial, sans-serif; |
1305 | + font-size: 13px; font-weight: bold; text-align: center; |
1306 | + text-decoration: none !important; line-height: 1; |
1307 | + padding: 5px 0px 0px 0px; background-color: #8E0000; |
1308 | + border-radius: 5px 5px; background-repeat: repeat no-repeat;" |
1309 | + |
1310 | + href="${object.web_url_view or ''}"> |
1311 | + View Expense |
1312 | + </a> |
1313 | + <br/> |
1314 | + </div> |
1315 | + ]]></field> |
1316 | + <field name="body_text"><![CDATA[ |
1317 | + Hello, |
1318 | + A new expense is waiting for approval. |
1319 | + You can view the expense using the following link: |
1320 | + ${object.web_url_view or 'n/a'} |
1321 | + ]]></field> |
1322 | + </record> |
1323 | + |
1324 | + |
1325 | + <!-- |
1326 | + Email template for approved expenses, asking the account manager to export the expense |
1327 | + --> |
1328 | + <record id="email_template_edi_expense_accepted" model="email.template"> |
1329 | + <field name="name">Automated Invoice Notification Mail</field> |
1330 | + <field name="email_from">${object.company_id.email or 'noreply@localhost'}</field> |
1331 | + <field name="subject">New expense approved and ready for export</field> |
1332 | + <field name="email_to">${object.manager_emails}</field> |
1333 | + <field name="model_id" ref="model_hr_expense_expense"/> |
1334 | + <field name="auto_delete" eval="True"/> |
1335 | + <field name="lang">${object.employee_id.partner_id.lang}</field> |
1336 | + <field name="body_html"><![CDATA[ |
1337 | + <div style=" |
1338 | + font-family : 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; |
1339 | + font-size : 12px; |
1340 | + color : rgb(34, 34, 34); |
1341 | + background-color: #FFF; |
1342 | + "> |
1343 | + |
1344 | + <p>Hello,</p> |
1345 | + <p>A new expense has been approved and is ready for export. </p> |
1346 | + <p>You can view the expense using the following link: </p> |
1347 | + <a style=" |
1348 | + display:block; width: 150px; height:20px; |
1349 | + margin-left: 20px; color: #DDD; |
1350 | + font-family: 'Lucida Grande', Helvetica, Arial, sans-serif; |
1351 | + font-size: 13px; font-weight: bold; text-align: center; |
1352 | + text-decoration: none !important; line-height: 1; |
1353 | + padding: 5px 0px 0px 0px; background-color: #8E0000; |
1354 | + border-radius: 5px 5px; background-repeat: repeat no-repeat;" |
1355 | + |
1356 | + href="${object.web_url_view or ''}"> |
1357 | + View Expense |
1358 | + </a> |
1359 | + <br/> |
1360 | + </div> |
1361 | + ]]></field> |
1362 | + <field name="body_text"><![CDATA[ |
1363 | + Hello, |
1364 | + A new expense has been approved and is ready for export. |
1365 | + You can view the expense using the following link: |
1366 | + ${object.web_url_view or 'n/a'} |
1367 | + ]]></field> |
1368 | + </record> |
1369 | + |
1370 | + </data> |
1371 | +</openerp> |
1372 | |
1373 | === added directory 'hr_expense_accountedge/i18n' |
1374 | === added file 'hr_expense_accountedge/i18n/fr.po' |
1375 | --- hr_expense_accountedge/i18n/fr.po 1970-01-01 00:00:00 +0000 |
1376 | +++ hr_expense_accountedge/i18n/fr.po 2013-08-12 22:45:40 +0000 |
1377 | @@ -0,0 +1,232 @@ |
1378 | +# Translation of OpenERP Server. |
1379 | +# This file contains the translation of the following modules: |
1380 | +# * hr_expense_accountedge |
1381 | +# |
1382 | +msgid "" |
1383 | +msgstr "" |
1384 | +"Project-Id-Version: OpenERP Server 6.1\n" |
1385 | +"Report-Msgid-Bugs-To: \n" |
1386 | +"POT-Creation-Date: 2013-07-19 19:38+0000\n" |
1387 | +"PO-Revision-Date: 2013-07-19 19:38+0000\n" |
1388 | +"Last-Translator: <>\n" |
1389 | +"Language-Team: \n" |
1390 | +"MIME-Version: 1.0\n" |
1391 | +"Content-Type: text/plain; charset=UTF-8\n" |
1392 | +"Content-Transfer-Encoding: \n" |
1393 | +"Plural-Forms: \n" |
1394 | + |
1395 | +#. module: hr_expense_accountedge |
1396 | +#: view:hr.expense.expense:0 |
1397 | +msgid "Refuse" |
1398 | +msgstr "Refuser" |
1399 | + |
1400 | +#. module: hr_expense_accountedge |
1401 | +#: model:ir.actions.server,name:hr_expense_accountedge.ir_actions_server_edi_expense_confirm |
1402 | +msgid "Auto-email expense waiting for approval" |
1403 | +msgstr "Courriel automatique des notes de frais en approbation" |
1404 | + |
1405 | +#. module: hr_expense_accountedge |
1406 | +#: model:email.template,body_html:hr_expense_accountedge.email_template_edi_expense_accepted |
1407 | +msgid "\n" |
1408 | +" <div style=\"\n" |
1409 | +" font-family : 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif;\n" |
1410 | +" font-size : 12px;\n" |
1411 | +" color : rgb(34, 34, 34);\n" |
1412 | +" background-color: #FFF;\n" |
1413 | +" \">\n" |
1414 | +"\n" |
1415 | +" <p>Hello,</p>\n" |
1416 | +" <p>A new expense has been approved and is ready for export. </p>\n" |
1417 | +" <p>You can view the expense using the following link: </p>\n" |
1418 | +" <a style=\"\n" |
1419 | +" display:block; width: 150px; height:20px;\n" |
1420 | +" margin-left: 20px; color: #DDD;\n" |
1421 | +" font-family: 'Lucida Grande', Helvetica, Arial, sans-serif;\n" |
1422 | +" font-size: 13px; font-weight: bold; text-align: center;\n" |
1423 | +" text-decoration: none !important; line-height: 1;\n" |
1424 | +" padding: 5px 0px 0px 0px; background-color: #8E0000;\n" |
1425 | +" border-radius: 5px 5px; background-repeat: repeat no-repeat;\"\n" |
1426 | +"\n" |
1427 | +" href=\"${object.web_url_view or ''}\">\n" |
1428 | +" View Expense\n" |
1429 | +" </a>\n" |
1430 | +" <br/>\n" |
1431 | +" </div>\n" |
1432 | +" " |
1433 | +msgstr "\n" |
1434 | +" <div style=\"\n" |
1435 | +" font-family : 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif;\n" |
1436 | +" font-size : 12px;\n" |
1437 | +" color : rgb(34, 34, 34);\n" |
1438 | +" background-color: #FFF;\n" |
1439 | +" \">\n" |
1440 | +"\n" |
1441 | +" <p>Bonjour,</p>\n" |
1442 | +" <p>Une nouvelle note de frais a été approuvé et est prête pour l'export. </p>\n" |
1443 | +" <p>Vous pouvez voir la note en utilisant le lien suivant: </p>\n" |
1444 | +" <a style=\"\n" |
1445 | +" display:block; width: 150px; height:20px;\n" |
1446 | +" margin-left: 20px; color: #DDD;\n" |
1447 | +" font-family: 'Lucida Grande', Helvetica, Arial, sans-serif;\n" |
1448 | +" font-size: 13px; font-weight: bold; text-align: center;\n" |
1449 | +" text-decoration: none !important; line-height: 1;\n" |
1450 | +" padding: 5px 0px 0px 0px; background-color: #8E0000;\n" |
1451 | +" border-radius: 5px 5px; background-repeat: repeat no-repeat;\"\n" |
1452 | +"\n" |
1453 | +" href=\"${object.web_url_view or ''}\">\n" |
1454 | +" Voir la note de frais\n" |
1455 | +" </a>\n" |
1456 | +" <br/>\n" |
1457 | +" </div>\n" |
1458 | +" " |
1459 | + |
1460 | +#. module: hr_expense_accountedge |
1461 | +#: model:email.template,body_text:hr_expense_accountedge.email_template_edi_expense_accepted |
1462 | +msgid "\n" |
1463 | +" Hello,\n" |
1464 | +" A new expense has been approved and is ready for export.\n" |
1465 | +" You can view the expense using the following link:\n" |
1466 | +" ${object.web_url_view or 'n/a'}\n" |
1467 | +" " |
1468 | +msgstr "\n" |
1469 | +" Bonjour,\n" |
1470 | +" Une nouvelle note de frais a été approuvé et est prête pour l'export.\n" |
1471 | +" Vous pouvez voir la note en utilisant le lien suivant:\n" |
1472 | +" ${object.web_url_view or 'n/a'}\n" |
1473 | +" " |
1474 | + |
1475 | +#. module: hr_expense_accountedge |
1476 | +#: model:email.template,subject:hr_expense_accountedge.email_template_edi_expense_accepted |
1477 | +msgid "New expense approved and ready for export" |
1478 | +msgstr "Nouvelle note approuvée et prête pour l'export" |
1479 | + |
1480 | +#. module: hr_expense_accountedge |
1481 | +#: view:hr.expense.expense:0 |
1482 | +msgid "Approve" |
1483 | +msgstr "Approuver" |
1484 | + |
1485 | +#. module: hr_expense_accountedge |
1486 | +#: view:hr.expense.expense:0 |
1487 | +msgid "Mark as imported" |
1488 | +msgstr "Marquer comme importée" |
1489 | + |
1490 | +#. module: hr_expense_accountedge |
1491 | +#: view:hr.expense.expense:0 |
1492 | +msgid "This action cannot be undone" |
1493 | +msgstr "Cette action est irréversible" |
1494 | + |
1495 | +#. module: hr_expense_accountedge |
1496 | +#: view:hr.expense.expense:0 |
1497 | +msgid "Export CSV" |
1498 | +msgstr "Exporter le CSV" |
1499 | + |
1500 | +#. module: hr_expense_accountedge |
1501 | +#: model:email.template,subject:hr_expense_accountedge.email_template_edi_expense_waiting_approval |
1502 | +msgid "New expense waiting for approval" |
1503 | +msgstr "Nouvelle note en attente d'approbation" |
1504 | + |
1505 | +#. module: hr_expense_accountedge |
1506 | +#: model:ir.actions.act_window,name:hr_expense_accountedge.action_email_templates_expenses |
1507 | +#: model:ir.ui.menu,name:hr_expense_accountedge.menu_email_templates_expenses |
1508 | +msgid "Email Templates" |
1509 | +msgstr "Modèles de courriel" |
1510 | + |
1511 | +#. module: hr_expense_accountedge |
1512 | +#: field:hr.expense.expense,web_url_view:0 |
1513 | +msgid "Url of the expense view" |
1514 | +msgstr "URL de la note" |
1515 | + |
1516 | +#. module: hr_expense_accountedge |
1517 | +#: field:hr.expense.expense,manager_emails:0 |
1518 | +msgid "Manager Emails" |
1519 | +msgstr "Courriels des responsables" |
1520 | + |
1521 | +#. module: hr_expense_accountedge |
1522 | +#: view:hr.expense.expense:0 |
1523 | +msgid "Set to Draft" |
1524 | +msgstr "Mettre en brouillon" |
1525 | + |
1526 | +#. module: hr_expense_accountedge |
1527 | +#: model:email.template,body_html:hr_expense_accountedge.email_template_edi_expense_waiting_approval |
1528 | +msgid "\n" |
1529 | +" <div style=\"\n" |
1530 | +" font-family : 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif;\n" |
1531 | +" font-size : 12px;\n" |
1532 | +" color : rgb(34, 34, 34);\n" |
1533 | +" background-color: #FFF;\n" |
1534 | +" \">\n" |
1535 | +"\n" |
1536 | +" <p>Hello,</p>\n" |
1537 | +" <p>A new expense is waiting for approval. </p>\n" |
1538 | +" <p>You can view the expense using the following link: </p>\n" |
1539 | +" <a style=\"\n" |
1540 | +" display:block; width: 150px; height:20px;\n" |
1541 | +" margin-left: 20px; color: #DDD;\n" |
1542 | +" font-family: 'Lucida Grande', Helvetica, Arial, sans-serif;\n" |
1543 | +" font-size: 13px; font-weight: bold; text-align: center;\n" |
1544 | +" text-decoration: none !important; line-height: 1;\n" |
1545 | +" padding: 5px 0px 0px 0px; background-color: #8E0000;\n" |
1546 | +" border-radius: 5px 5px; background-repeat: repeat no-repeat;\"\n" |
1547 | +"\n" |
1548 | +" href=\"${object.web_url_view or ''}\">\n" |
1549 | +" View Expense\n" |
1550 | +" </a>\n" |
1551 | +" <br/>\n" |
1552 | +" </div>\n" |
1553 | +" " |
1554 | +msgstr "\n" |
1555 | +" <div style=\"\n" |
1556 | +" font-family : 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif;\n" |
1557 | +" font-size : 12px;\n" |
1558 | +" color : rgb(34, 34, 34);\n" |
1559 | +" background-color: #FFF;\n" |
1560 | +" \">\n" |
1561 | +"\n" |
1562 | +" <p>Bonjour,</p>\n" |
1563 | +" <p>Une nouvelle note est en attente d'approbation. </p>\n" |
1564 | +" <p>Vous pouvez voir la note en cliquant sur le lien suivant: </p>\n" |
1565 | +" <a style=\"\n" |
1566 | +" display:block; width: 150px; height:20px;\n" |
1567 | +" margin-left: 20px; color: #DDD;\n" |
1568 | +" font-family: 'Lucida Grande', Helvetica, Arial, sans-serif;\n" |
1569 | +" font-size: 13px; font-weight: bold; text-align: center;\n" |
1570 | +" text-decoration: none !important; line-height: 1;\n" |
1571 | +" padding: 5px 0px 0px 0px; background-color: #8E0000;\n" |
1572 | +" border-radius: 5px 5px; background-repeat: repeat no-repeat;\"\n" |
1573 | +"\n" |
1574 | +" href=\"${object.web_url_view or ''}\">\n" |
1575 | +" Voir la note de frais\n" |
1576 | +" </a>\n" |
1577 | +" <br/>\n" |
1578 | +" </div>\n" |
1579 | +" " |
1580 | + |
1581 | +#. module: hr_expense_accountedge |
1582 | +#: view:hr.expense.expense:0 |
1583 | +msgid "Submit to Manager" |
1584 | +msgstr "Soumettre au responsable" |
1585 | + |
1586 | +#. module: hr_expense_accountedge |
1587 | +#: model:ir.model,name:hr_expense_accountedge.model_hr_expense_expense |
1588 | +msgid "Expense" |
1589 | +msgstr "Note de frais" |
1590 | + |
1591 | +#. module: hr_expense_accountedge |
1592 | +#: model:ir.actions.server,name:hr_expense_accountedge.ir_actions_server_edi_expense_approved |
1593 | +msgid "Auto-email expense approved" |
1594 | +msgstr "Courriel automatique des notes de frais approuvées" |
1595 | + |
1596 | +#. module: hr_expense_accountedge |
1597 | +#: model:email.template,body_text:hr_expense_accountedge.email_template_edi_expense_waiting_approval |
1598 | +msgid "\n" |
1599 | +" Hello,\n" |
1600 | +" A new expense is waiting for approval.\n" |
1601 | +" You can view the expense using the following link:\n" |
1602 | +" ${object.web_url_view or 'n/a'}\n" |
1603 | +" " |
1604 | +msgstr "\n" |
1605 | +" Bonjour,\n" |
1606 | +" Une nouvelle note de frais est en attente d'approbation.\n" |
1607 | +" Vous pouvez voir la note en cliquant sur le lien suivant:\n" |
1608 | +" ${object.web_url_view or 'n/a'}\n" |
1609 | +" " |
1610 | |
1611 | === added file 'hr_expense_accountedge/i18n/hr_expense_accountedge.pot' |
1612 | --- hr_expense_accountedge/i18n/hr_expense_accountedge.pot 1970-01-01 00:00:00 +0000 |
1613 | +++ hr_expense_accountedge/i18n/hr_expense_accountedge.pot 2013-08-12 22:45:40 +0000 |
1614 | @@ -0,0 +1,183 @@ |
1615 | +# Translation of OpenERP Server. |
1616 | +# This file contains the translation of the following modules: |
1617 | +# * hr_expense_accountedge |
1618 | +# |
1619 | +msgid "" |
1620 | +msgstr "" |
1621 | +"Project-Id-Version: OpenERP Server 6.1\n" |
1622 | +"Report-Msgid-Bugs-To: \n" |
1623 | +"POT-Creation-Date: 2013-08-08 20:04+0000\n" |
1624 | +"PO-Revision-Date: 2013-08-08 20:04+0000\n" |
1625 | +"Last-Translator: <>\n" |
1626 | +"Language-Team: \n" |
1627 | +"MIME-Version: 1.0\n" |
1628 | +"Content-Type: text/plain; charset=UTF-8\n" |
1629 | +"Content-Transfer-Encoding: \n" |
1630 | +"Plural-Forms: \n" |
1631 | + |
1632 | +#. module: hr_expense_accountedge |
1633 | +#: view:hr.expense.expense:0 |
1634 | +msgid "Refuse" |
1635 | +msgstr "" |
1636 | + |
1637 | +#. module: hr_expense_accountedge |
1638 | +#: model:ir.actions.server,name:hr_expense_accountedge.ir_actions_server_edi_expense_confirm |
1639 | +msgid "Auto-email expense waiting for approval" |
1640 | +msgstr "" |
1641 | + |
1642 | +#. module: hr_expense_accountedge |
1643 | +#: model:email.template,body_html:hr_expense_accountedge.email_template_edi_expense_accepted |
1644 | +msgid "\n" |
1645 | +" <div style=\"\n" |
1646 | +" font-family : 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif;\n" |
1647 | +" font-size : 12px;\n" |
1648 | +" color : rgb(34, 34, 34);\n" |
1649 | +" background-color: #FFF;\n" |
1650 | +" \">\n" |
1651 | +"\n" |
1652 | +" <p>Hello,</p>\n" |
1653 | +" <p>A new expense has been approved and is ready for export. </p>\n" |
1654 | +" <p>You can view the expense using the following link: </p>\n" |
1655 | +" <a style=\"\n" |
1656 | +" display:block; width: 150px; height:20px;\n" |
1657 | +" margin-left: 20px; color: #DDD;\n" |
1658 | +" font-family: 'Lucida Grande', Helvetica, Arial, sans-serif;\n" |
1659 | +" font-size: 13px; font-weight: bold; text-align: center;\n" |
1660 | +" text-decoration: none !important; line-height: 1;\n" |
1661 | +" padding: 5px 0px 0px 0px; background-color: #8E0000;\n" |
1662 | +" border-radius: 5px 5px; background-repeat: repeat no-repeat;\"\n" |
1663 | +"\n" |
1664 | +" href=\"${object.web_url_view or ''}\">\n" |
1665 | +" View Expense\n" |
1666 | +" </a>\n" |
1667 | +" <br/>\n" |
1668 | +" </div>\n" |
1669 | +" " |
1670 | +msgstr "" |
1671 | + |
1672 | +#. module: hr_expense_accountedge |
1673 | +#: model:email.template,body_text:hr_expense_accountedge.email_template_edi_expense_accepted |
1674 | +msgid "\n" |
1675 | +" Hello,\n" |
1676 | +" A new expense has been approved and is ready for export.\n" |
1677 | +" You can view the expense using the following link:\n" |
1678 | +" ${object.web_url_view or 'n/a'}\n" |
1679 | +" " |
1680 | +msgstr "" |
1681 | + |
1682 | +#. module: hr_expense_accountedge |
1683 | +#: view:hr.expense.expense:0 |
1684 | +msgid "Mark as imported" |
1685 | +msgstr "" |
1686 | + |
1687 | +#. module: hr_expense_accountedge |
1688 | +#: field:hr.expense.expense,web_url_view:0 |
1689 | +msgid "Url of the expense view" |
1690 | +msgstr "" |
1691 | + |
1692 | +#. module: hr_expense_accountedge |
1693 | +#: view:hr.expense.expense:0 |
1694 | +msgid "Approve" |
1695 | +msgstr "" |
1696 | + |
1697 | +#. module: hr_expense_accountedge |
1698 | +#: model:ir.model,name:hr_expense_accountedge.model_hr_expense_line |
1699 | +msgid "Expense Line" |
1700 | +msgstr "" |
1701 | + |
1702 | +#. module: hr_expense_accountedge |
1703 | +#: model:email.template,subject:hr_expense_accountedge.email_template_edi_expense_accepted |
1704 | +msgid "New expense approved and ready for export" |
1705 | +msgstr "" |
1706 | + |
1707 | +#. module: hr_expense_accountedge |
1708 | +#: view:hr.expense.expense:0 |
1709 | +msgid "Export CSV" |
1710 | +msgstr "" |
1711 | + |
1712 | +#. module: hr_expense_accountedge |
1713 | +#: model:email.template,subject:hr_expense_accountedge.email_template_edi_expense_waiting_approval |
1714 | +msgid "New expense waiting for approval" |
1715 | +msgstr "" |
1716 | + |
1717 | +#. module: hr_expense_accountedge |
1718 | +#: model:ir.actions.act_window,name:hr_expense_accountedge.action_email_templates_expenses |
1719 | +#: model:ir.ui.menu,name:hr_expense_accountedge.menu_email_templates_expenses |
1720 | +msgid "Email Templates" |
1721 | +msgstr "" |
1722 | + |
1723 | +#. module: hr_expense_accountedge |
1724 | +#: field:hr.expense.line,state:0 |
1725 | +msgid "Expense State" |
1726 | +msgstr "" |
1727 | + |
1728 | +#. module: hr_expense_accountedge |
1729 | +#: field:hr.expense.expense,manager:0 |
1730 | +msgid "Manager" |
1731 | +msgstr "" |
1732 | + |
1733 | +#. module: hr_expense_accountedge |
1734 | +#: view:hr.expense.expense:0 |
1735 | +msgid "Set to Draft" |
1736 | +msgstr "" |
1737 | + |
1738 | +#. module: hr_expense_accountedge |
1739 | +#: model:email.template,body_html:hr_expense_accountedge.email_template_edi_expense_waiting_approval |
1740 | +msgid "\n" |
1741 | +" <div style=\"\n" |
1742 | +" font-family : 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif;\n" |
1743 | +" font-size : 12px;\n" |
1744 | +" color : rgb(34, 34, 34);\n" |
1745 | +" background-color: #FFF;\n" |
1746 | +" \">\n" |
1747 | +"\n" |
1748 | +" <p>Hello,</p>\n" |
1749 | +" <p>A new expense is waiting for approval. </p>\n" |
1750 | +" <p>You can view the expense using the following link: </p>\n" |
1751 | +" <a style=\"\n" |
1752 | +" display:block; width: 150px; height:20px;\n" |
1753 | +" margin-left: 20px; color: #DDD;\n" |
1754 | +" font-family: 'Lucida Grande', Helvetica, Arial, sans-serif;\n" |
1755 | +" font-size: 13px; font-weight: bold; text-align: center;\n" |
1756 | +" text-decoration: none !important; line-height: 1;\n" |
1757 | +" padding: 5px 0px 0px 0px; background-color: #8E0000;\n" |
1758 | +" border-radius: 5px 5px; background-repeat: repeat no-repeat;\"\n" |
1759 | +"\n" |
1760 | +" href=\"${object.web_url_view or ''}\">\n" |
1761 | +" View Expense\n" |
1762 | +" </a>\n" |
1763 | +" <br/>\n" |
1764 | +" </div>\n" |
1765 | +" " |
1766 | +msgstr "" |
1767 | + |
1768 | +#. module: hr_expense_accountedge |
1769 | +#: view:hr.expense.expense:0 |
1770 | +msgid "Submit to Manager" |
1771 | +msgstr "" |
1772 | + |
1773 | +#. module: hr_expense_accountedge |
1774 | +#: model:ir.model,name:hr_expense_accountedge.model_hr_expense_expense |
1775 | +msgid "Expense" |
1776 | +msgstr "" |
1777 | + |
1778 | +#. module: hr_expense_accountedge |
1779 | +#: model:ir.actions.server,name:hr_expense_accountedge.ir_actions_server_edi_expense_approved |
1780 | +msgid "Auto-email expense approved" |
1781 | +msgstr "" |
1782 | + |
1783 | +#. module: hr_expense_accountedge |
1784 | +#: view:hr.expense.expense:0 |
1785 | +msgid "This action cannot be undone" |
1786 | +msgstr "" |
1787 | + |
1788 | +#. module: hr_expense_accountedge |
1789 | +#: model:email.template,body_text:hr_expense_accountedge.email_template_edi_expense_waiting_approval |
1790 | +msgid "\n" |
1791 | +" Hello,\n" |
1792 | +" A new expense is waiting for approval.\n" |
1793 | +" You can view the expense using the following link:\n" |
1794 | +" ${object.web_url_view or 'n/a'}\n" |
1795 | +" " |
1796 | +msgstr "" |
1797 | + |
1798 | |
1799 | === added directory 'hr_expense_accountedge/security' |
1800 | === added file 'hr_expense_accountedge/security/ir_rule.xml' |
1801 | --- hr_expense_accountedge/security/ir_rule.xml 1970-01-01 00:00:00 +0000 |
1802 | +++ hr_expense_accountedge/security/ir_rule.xml 2013-08-12 22:45:40 +0000 |
1803 | @@ -0,0 +1,13 @@ |
1804 | +<?xml version="1.0" ?> |
1805 | +<openerp> |
1806 | + <data noupdate="1"> |
1807 | + |
1808 | + <record id="property_rule_account_invoice_manager" model="ir.rule"> |
1809 | + <field name="name">Account invoice and manager</field> |
1810 | + <field model="ir.model" name="model_id" ref="model_hr_expense_expense"/> |
1811 | + <field name="domain_force">[(1,'=',1)]</field> |
1812 | + <field name="groups" eval="[(4,ref('account.group_account_invoice'))]"/> |
1813 | + </record> |
1814 | + </data> |
1815 | +</openerp> |
1816 | + |
1817 | |
1818 | === added directory 'hr_expense_accountedge/tools' |
1819 | === added file 'hr_expense_accountedge/tools/hr_expense_accountedge.tsv' |
1820 | --- hr_expense_accountedge/tools/hr_expense_accountedge.tsv 1970-01-01 00:00:00 +0000 |
1821 | +++ hr_expense_accountedge/tools/hr_expense_accountedge.tsv 2013-08-12 22:45:40 +0000 |
1822 | @@ -0,0 +1,4 @@ |
1823 | +Card ID Date Vendor Invoice # Account Number Amount Description Tax Code GST Amount PST/QST Amount Currency Code Exchange Rate |
1824 | |
1825 | +2345 18-07-2023 6 6-5301 478.34 Basic PC 140 23.92 47.74 CAD 1.00 |
1826 | |
1827 | +2345 18-07-2023 6 6-5301 260.91 Basic PC 140 13.05 26.04 CAD 1.00 |
1828 | |
1829 | + |
1830 | |
1831 | |
1832 | === added file 'hr_expense_accountedge/tools/import_expenses.bat' |
1833 | --- hr_expense_accountedge/tools/import_expenses.bat 1970-01-01 00:00:00 +0000 |
1834 | +++ hr_expense_accountedge/tools/import_expenses.bat 2013-08-12 22:45:40 +0000 |
1835 | @@ -0,0 +1,1 @@ |
1836 | +c:\Python27\python.exe "C:\Users\N\Desktop\import_expenses\import_expenses.py" |
1837 | |
1838 | === added file 'hr_expense_accountedge/tools/import_expenses.py' |
1839 | --- hr_expense_accountedge/tools/import_expenses.py 1970-01-01 00:00:00 +0000 |
1840 | +++ hr_expense_accountedge/tools/import_expenses.py 2013-08-12 22:45:40 +0000 |
1841 | @@ -0,0 +1,109 @@ |
1842 | +# -*- encoding: utf-8 -*- |
1843 | +############################################################################## |
1844 | +# |
1845 | +# OpenERP, Open Source Management Solution |
1846 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
1847 | +# |
1848 | +# This program is free software: you can redistribute it and/or modify |
1849 | +# it under the terms of the GNU General Public License as |
1850 | +# published by the Free Software Foundation, either version 3 of the |
1851 | +# License, or (at your option) any later version. |
1852 | +# |
1853 | +# This program is distributed in the hope that it will be useful, |
1854 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1855 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1856 | +# GNU General Public License for more details. |
1857 | +# |
1858 | +# You should have received a copy of the GNU General Public License |
1859 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. |
1860 | +# |
1861 | +############################################################################## |
1862 | + |
1863 | +import xmlrpclib |
1864 | +import base64 |
1865 | +import getpass |
1866 | +from datetime import datetime |
1867 | + |
1868 | +def main(): |
1869 | + username = 'openerp_user' |
1870 | + dbname = '' |
1871 | + server_url = 'http://localhost:8069' |
1872 | + csv_path = 'hr_expense_accountedge.txt' |
1873 | + |
1874 | + pwd = getpass.getpass(prompt="Please enter the password of %s: " % username) |
1875 | + |
1876 | + # Get the uid |
1877 | + sock_common = xmlrpclib.ServerProxy('%s/xmlrpc/common' % server_url) |
1878 | + uid = sock_common.login(dbname, username, pwd) |
1879 | + |
1880 | + if not uid: |
1881 | + print "Connection error. Please check the username, password and server url." |
1882 | + goodbye = raw_input("Type 'enter' to quit...") |
1883 | + return 1 |
1884 | + |
1885 | + # Replace localhost with the address of the server |
1886 | + sock = xmlrpclib.ServerProxy('%s/xmlrpc/object' % server_url) |
1887 | + |
1888 | + # Search for exported expense notes |
1889 | + args = [('state', '=', 'exported')] |
1890 | + expense_ids = sock.execute(dbname, uid, pwd, 'hr.expense.expense', 'search', args) |
1891 | + |
1892 | + print "There are %d expense sheets to import" % len(expense_ids) |
1893 | + |
1894 | + if not expense_ids: |
1895 | + goodbye = raw_input("Type 'enter' to quit...") |
1896 | + return 1 |
1897 | + |
1898 | + # Outpout file for AccountEdge |
1899 | + final_csv = open(csv_path, 'w') |
1900 | + |
1901 | + num_expense = 0 |
1902 | + |
1903 | + # For each exported expense note, search for the tsv attachment |
1904 | + for expense_id in expense_ids: |
1905 | + |
1906 | + args = [('res_model','=','hr.expense.expense'),('res_id', '=', expense_id)] |
1907 | + csv_ids = sock.execute(dbname, uid, pwd, 'ir.attachment', 'search', args) |
1908 | + |
1909 | + fields = ['name', 'datas'] |
1910 | + csv_obj = sock.execute(dbname, uid, pwd, 'ir.attachment', 'read', csv_ids, fields) |
1911 | + |
1912 | + latest_csv = None |
1913 | + latest_date = datetime(2000, 1, 1, 0, 0, 0) |
1914 | + |
1915 | + # Find the latest csv |
1916 | + for csv in csv_obj: |
1917 | + |
1918 | + format = 'export_%Y%m%d_%H%M%S.tsv' |
1919 | + date_created = datetime.strptime(csv["name"], format) |
1920 | + |
1921 | + if date_created > latest_date: |
1922 | + latest_date = date_created |
1923 | + latest_csv = csv |
1924 | + |
1925 | + # Copy the lines to the new summary file |
1926 | + if latest_csv: |
1927 | + content = base64.b64decode(csv['datas']) |
1928 | + content = content.split("\r\n") |
1929 | + |
1930 | + |
1931 | + for num_line in range(len(content)): |
1932 | + if (num_line == 1 and num_expense == 0) or num_line > 1: |
1933 | + final_csv.write(content[num_line]) |
1934 | + final_csv.write("\r\n") |
1935 | + |
1936 | + |
1937 | + num_expense = num_expense + 1 |
1938 | + |
1939 | + |
1940 | + # Mark the expenses as imported |
1941 | + values = {'state': 'exported'} |
1942 | + result = sock.execute(dbname, uid, pwd, 'hr.expense.expense', 'write', expense_ids, values) |
1943 | + |
1944 | + final_csv.close() |
1945 | + |
1946 | + goodbye = raw_input("Type 'enter' to quit...") |
1947 | + |
1948 | +if __name__ == "__main__": |
1949 | + main() |
1950 | + |
1951 | |
1952 | === added directory 'hr_expense_line_account' |
1953 | === added file 'hr_expense_line_account/__init__.py' |
1954 | --- hr_expense_line_account/__init__.py 1970-01-01 00:00:00 +0000 |
1955 | +++ hr_expense_line_account/__init__.py 2013-08-12 22:45:40 +0000 |
1956 | @@ -0,0 +1,22 @@ |
1957 | +# -*- encoding: utf-8 -*- |
1958 | +############################################################################## |
1959 | +#···· |
1960 | +# OpenERP, Open Source Management Solution |
1961 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
1962 | +# |
1963 | +# This program is free software: you can redistribute it and/or modify |
1964 | +# it under the terms of the GNU General Public License as |
1965 | +# published by the Free Software Foundation, either version 3 of the |
1966 | +# License, or (at your option) any later version. |
1967 | +# |
1968 | +# This program is distributed in the hope that it will be useful, |
1969 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1970 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1971 | +# GNU General Public License for more details. |
1972 | +# |
1973 | +# You should have received a copy of the GNU General Public License |
1974 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
1975 | +# |
1976 | +############################################################################## |
1977 | +import hr_expense_line_account |
1978 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
1979 | |
1980 | === added file 'hr_expense_line_account/__openerp__.py' |
1981 | --- hr_expense_line_account/__openerp__.py 1970-01-01 00:00:00 +0000 |
1982 | +++ hr_expense_line_account/__openerp__.py 2013-08-12 22:45:40 +0000 |
1983 | @@ -0,0 +1,40 @@ |
1984 | +# -*- encoding: utf-8 -*- |
1985 | +############################################################################## |
1986 | +#···· |
1987 | +# OpenERP, Open Source Management Solution |
1988 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
1989 | +# |
1990 | +# This program is free software: you can redistribute it and/or modify |
1991 | +# it under the terms of the GNU General Public License as |
1992 | +# published by the Free Software Foundation, either version 3 of the |
1993 | +# License, or (at your option) any later version. |
1994 | +# |
1995 | +# This program is distributed in the hope that it will be useful, |
1996 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
1997 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
1998 | +# GNU General Public License for more details. |
1999 | +# |
2000 | +# You should have received a copy of the GNU General Public License |
2001 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
2002 | +# |
2003 | +############################################################################## |
2004 | +{ |
2005 | + "name" : "Account id on expense line", |
2006 | + "version" : "1.0", |
2007 | + "author" : "Savoir-faire Linux", |
2008 | + "website" : "http://www.savoirfairelinux.com", |
2009 | + "category" : "Human Resources", |
2010 | + "description": """ |
2011 | + This module adds the account id field to hr.expense.line |
2012 | + """, |
2013 | + "depends" : ['hr_expense'], |
2014 | + "init_xml" : [], |
2015 | + "update_xml" : [ |
2016 | + 'hr_expense_line_account.xml', |
2017 | + ], |
2018 | + "demo_xml" : [], |
2019 | + "installable" : True, |
2020 | + "certificate" : '' |
2021 | +} |
2022 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2023 | + |
2024 | |
2025 | === added file 'hr_expense_line_account/hr_expense_line_account.py' |
2026 | --- hr_expense_line_account/hr_expense_line_account.py 1970-01-01 00:00:00 +0000 |
2027 | +++ hr_expense_line_account/hr_expense_line_account.py 2013-08-12 22:45:40 +0000 |
2028 | @@ -0,0 +1,72 @@ |
2029 | +# -*- encoding: utf-8 -*- |
2030 | +############################################################################## |
2031 | +#···· |
2032 | +# OpenERP, Open Source Management Solution |
2033 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2034 | +# |
2035 | +# This program is free software: you can redistribute it and/or modify |
2036 | +# it under the terms of the GNU General Public License as |
2037 | +# published by the Free Software Foundation, either version 3 of the |
2038 | +# License, or (at your option) any later version. |
2039 | +# |
2040 | +# This program is distributed in the hope that it will be useful, |
2041 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2042 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2043 | +# GNU General Public License for more details. |
2044 | +# |
2045 | +# You should have received a copy of the GNU General Public License |
2046 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
2047 | +# |
2048 | +############################################################################## |
2049 | + |
2050 | +from osv import osv, fields |
2051 | + |
2052 | +class hr_expense_line(osv.osv): |
2053 | + _inherit = 'hr.expense.line' |
2054 | + _columns = { |
2055 | + 'account_id': fields.many2one('account.account', 'Financial Account'), |
2056 | + } |
2057 | + |
2058 | + def get_account_id(self, cr, uid, product_id, context=None): |
2059 | + ''' |
2060 | + Get the automatic value of the account_id field. |
2061 | + ''' |
2062 | + # Retrieve the product |
2063 | + product = self.pool.get('product.product').browse(cr, uid, product_id) |
2064 | + # Product -> Accounting -> Expense account |
2065 | + exp_acc = product.product_tmpl_id.property_account_expense |
2066 | + |
2067 | + # If the field is empty |
2068 | + if not exp_acc: |
2069 | + # Find the product's 'Parent category' |
2070 | + parent_category = product.product_tmpl_id.categ_id |
2071 | + # Try to find the expense account of the parent category |
2072 | + exp_acc = parent_category.property_account_expense_categ |
2073 | + |
2074 | + if exp_acc: |
2075 | + return exp_acc.id |
2076 | + |
2077 | + return None |
2078 | + |
2079 | + |
2080 | + def create(self, cr, user, vals, context=None): |
2081 | + ''' |
2082 | + Overwrite the create() function to automatically set the default account id |
2083 | + since regular employees cannot access this field. |
2084 | + ''' |
2085 | + vals['account_id'] = self.get_account_id(cr, user, vals['product_id'], context) |
2086 | + return super(hr_expense_line,self).create(cr, user, vals, context) |
2087 | + |
2088 | + |
2089 | + def onchange_product_id(self, cr, uid, ids, product_id, uom_id, employee_id, context=None): |
2090 | + if product_id: |
2091 | + values = super(hr_expense_line, self).onchange_product_id(cr, uid, ids, product_id, uom_id, employee_id, context=context) |
2092 | + for id in ids: |
2093 | + this = self.browse(cr, uid, id) |
2094 | + account_id = self.get_account_id(cr, uid, product_id, context) |
2095 | + values['value'].update({ |
2096 | + 'account_id' : account_id |
2097 | + }) |
2098 | + return values |
2099 | + |
2100 | +hr_expense_line() |
2101 | |
2102 | === added file 'hr_expense_line_account/hr_expense_line_account.xml' |
2103 | --- hr_expense_line_account/hr_expense_line_account.xml 1970-01-01 00:00:00 +0000 |
2104 | +++ hr_expense_line_account/hr_expense_line_account.xml 2013-08-12 22:45:40 +0000 |
2105 | @@ -0,0 +1,28 @@ |
2106 | +<?xml version="1.0" encoding="utf-8"?> |
2107 | +<openerp> |
2108 | + <data> |
2109 | + <record id="view_expenses_tree" model="ir.ui.view"> |
2110 | + <field name="name">hr.expense.line.tree</field> |
2111 | + <field name="model">hr.expense.line</field> |
2112 | + <field name="inherit_id" ref="hr_expense.view_expenses_line_tree"/> |
2113 | + <field name="arch" type="xml"> |
2114 | + <field name="unit_amount" position="before"> |
2115 | + <field name="account_id" groups="account.group_account_invoice"/> |
2116 | + </field> |
2117 | + </field> |
2118 | + </record> |
2119 | + |
2120 | + <record id="view_expenses_form" model="ir.ui.view"> |
2121 | + <field name="name">hr.expense.form</field> |
2122 | + <field name="model">hr.expense.expense</field> |
2123 | + <field name="inherit_id" ref="hr_expense.view_expenses_form"/> |
2124 | + <field name="arch" type="xml"> |
2125 | + <field name="unit_quantity" position="after"> |
2126 | + <newline/> |
2127 | + <field name="account_id" groups="account.group_account_invoice"/> |
2128 | + <newline/> |
2129 | + </field> |
2130 | + </field> |
2131 | + </record> |
2132 | + </data> |
2133 | +</openerp> |
2134 | |
2135 | === added directory 'hr_expense_line_account/i18n' |
2136 | === added file 'hr_expense_line_account/i18n/fr.po' |
2137 | --- hr_expense_line_account/i18n/fr.po 1970-01-01 00:00:00 +0000 |
2138 | +++ hr_expense_line_account/i18n/fr.po 2013-08-12 22:45:40 +0000 |
2139 | @@ -0,0 +1,27 @@ |
2140 | +# Translation of OpenERP Server. |
2141 | +# This file contains the translation of the following modules: |
2142 | +# * hr_expense_line_account |
2143 | +# |
2144 | +msgid "" |
2145 | +msgstr "" |
2146 | +"Project-Id-Version: OpenERP Server 6.1\n" |
2147 | +"Report-Msgid-Bugs-To: \n" |
2148 | +"POT-Creation-Date: 2013-07-19 19:39+0000\n" |
2149 | +"PO-Revision-Date: 2013-07-19 19:39+0000\n" |
2150 | +"Last-Translator: <>\n" |
2151 | +"Language-Team: \n" |
2152 | +"MIME-Version: 1.0\n" |
2153 | +"Content-Type: text/plain; charset=UTF-8\n" |
2154 | +"Content-Transfer-Encoding: \n" |
2155 | +"Plural-Forms: \n" |
2156 | + |
2157 | +#. module: hr_expense_line_account |
2158 | +#: field:hr.expense.line,account_id:0 |
2159 | +msgid "Financial Account" |
2160 | +msgstr "Compte financier" |
2161 | + |
2162 | +#. module: hr_expense_line_account |
2163 | +#: model:ir.model,name:hr_expense_line_account.model_hr_expense_line |
2164 | +msgid "Expense Line" |
2165 | +msgstr "Ligne de frais" |
2166 | + |
2167 | |
2168 | === added file 'hr_expense_line_account/i18n/hr_expense_line_account.pot' |
2169 | --- hr_expense_line_account/i18n/hr_expense_line_account.pot 1970-01-01 00:00:00 +0000 |
2170 | +++ hr_expense_line_account/i18n/hr_expense_line_account.pot 2013-08-12 22:45:40 +0000 |
2171 | @@ -0,0 +1,27 @@ |
2172 | +# Translation of OpenERP Server. |
2173 | +# This file contains the translation of the following modules: |
2174 | +# * hr_expense_line_account |
2175 | +# |
2176 | +msgid "" |
2177 | +msgstr "" |
2178 | +"Project-Id-Version: OpenERP Server 6.1\n" |
2179 | +"Report-Msgid-Bugs-To: \n" |
2180 | +"POT-Creation-Date: 2013-07-19 19:39+0000\n" |
2181 | +"PO-Revision-Date: 2013-07-19 19:39+0000\n" |
2182 | +"Last-Translator: <>\n" |
2183 | +"Language-Team: \n" |
2184 | +"MIME-Version: 1.0\n" |
2185 | +"Content-Type: text/plain; charset=UTF-8\n" |
2186 | +"Content-Transfer-Encoding: \n" |
2187 | +"Plural-Forms: \n" |
2188 | + |
2189 | +#. module: hr_expense_line_account |
2190 | +#: field:hr.expense.line,account_id:0 |
2191 | +msgid "Financial Account" |
2192 | +msgstr "" |
2193 | + |
2194 | +#. module: hr_expense_line_account |
2195 | +#: model:ir.model,name:hr_expense_line_account.model_hr_expense_line |
2196 | +msgid "Expense Line" |
2197 | +msgstr "" |
2198 | + |
2199 | |
2200 | === added directory 'hr_expense_line_sequence' |
2201 | === added file 'hr_expense_line_sequence/__init__.py' |
2202 | --- hr_expense_line_sequence/__init__.py 1970-01-01 00:00:00 +0000 |
2203 | +++ hr_expense_line_sequence/__init__.py 2013-08-12 22:45:40 +0000 |
2204 | @@ -0,0 +1,23 @@ |
2205 | +# -*- encoding: utf-8 -*- |
2206 | +############################################################################## |
2207 | +#···· |
2208 | +# OpenERP, Open Source Management Solution |
2209 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2210 | +# |
2211 | +# This program is free software: you can redistribute it and/or modify |
2212 | +# it under the terms of the GNU General Public License as |
2213 | +# published by the Free Software Foundation, either version 3 of the |
2214 | +# License, or (at your option) any later version. |
2215 | +# |
2216 | +# This program is distributed in the hope that it will be useful, |
2217 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2218 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2219 | +# GNU General Public License for more details. |
2220 | +# |
2221 | +# You should have received a copy of the GNU General Public License |
2222 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
2223 | +# |
2224 | +############################################################################## |
2225 | +import hr_expense_line_sequence |
2226 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2227 | + |
2228 | |
2229 | === added file 'hr_expense_line_sequence/__openerp__.py' |
2230 | --- hr_expense_line_sequence/__openerp__.py 1970-01-01 00:00:00 +0000 |
2231 | +++ hr_expense_line_sequence/__openerp__.py 2013-08-12 22:45:40 +0000 |
2232 | @@ -0,0 +1,40 @@ |
2233 | +# -*- encoding: utf-8 -*- |
2234 | +############################################################################## |
2235 | +#···· |
2236 | +# OpenERP, Open Source Management Solution |
2237 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2238 | +# |
2239 | +# This program is free software: you can redistribute it and/or modify |
2240 | +# it under the terms of the GNU General Public License as |
2241 | +# published by the Free Software Foundation, either version 3 of the |
2242 | +# License, or (at your option) any later version. |
2243 | +# |
2244 | +# This program is distributed in the hope that it will be useful, |
2245 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2246 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2247 | +# GNU General Public License for more details. |
2248 | +# |
2249 | +# You should have received a copy of the GNU General Public License |
2250 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
2251 | +# |
2252 | +############################################################################## |
2253 | +{ |
2254 | + "name" : "Sequence on expense line", |
2255 | + "version" : "1.0", |
2256 | + "author" : "Savoir-faire Linux", |
2257 | + "website" : "http://www.savoirfairelinux.com", |
2258 | + "category" : "Human Resources", |
2259 | + "description": """ |
2260 | + This module adds a sequence number field on the expense line. |
2261 | + """, |
2262 | + "depends" : ['hr_expense'], |
2263 | + "init_xml" : [], |
2264 | + "update_xml" : [ |
2265 | + 'hr_expense_line_sequence.xml', |
2266 | + ], |
2267 | + "demo_xml" : [], |
2268 | + "installable" : True, |
2269 | + "certificate" : '' |
2270 | +} |
2271 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2272 | + |
2273 | |
2274 | === added file 'hr_expense_line_sequence/hr_expense_line_sequence.py' |
2275 | --- hr_expense_line_sequence/hr_expense_line_sequence.py 1970-01-01 00:00:00 +0000 |
2276 | +++ hr_expense_line_sequence/hr_expense_line_sequence.py 2013-08-12 22:45:40 +0000 |
2277 | @@ -0,0 +1,65 @@ |
2278 | +# -*- encoding: utf-8 -*- |
2279 | +############################################################################## |
2280 | +#···· |
2281 | +# OpenERP, Open Source Management Solution |
2282 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2283 | +# |
2284 | +# This program is free software: you can redistribute it and/or modify |
2285 | +# it under the terms of the GNU General Public License as |
2286 | +# published by the Free Software Foundation, either version 3 of the |
2287 | +# License, or (at your option) any later version. |
2288 | +# |
2289 | +# This program is distributed in the hope that it will be useful, |
2290 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2291 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2292 | +# GNU General Public License for more details. |
2293 | +# |
2294 | +# You should have received a copy of the GNU General Public License |
2295 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
2296 | +# |
2297 | +############################################################################## |
2298 | + |
2299 | +from osv import osv, fields |
2300 | + |
2301 | +class hr_expense_line(osv.osv): |
2302 | + _inherit = 'hr.expense.line' |
2303 | + _columns = { |
2304 | + 'sequence': fields.integer('N°', required=True), |
2305 | + } |
2306 | + _defaults = { |
2307 | + 'sequence': lambda obj, cr, uid, context:0 |
2308 | + } |
2309 | + |
2310 | + def update_sequences(self, cr, uid, expense, context=None): |
2311 | + ''' Updating the sequences (line numbers) of an hr.expense |
2312 | + object. ''' |
2313 | + num = 0 |
2314 | + for l in expense.line_ids: |
2315 | + num = num + 1 |
2316 | + self.write(cr, uid, l.id, {'sequence':num}) |
2317 | + |
2318 | + def unlink(self, cr, uid, ids, context=None): |
2319 | + ''' Overwriting the unlink() method |
2320 | + to update the line numbers of the expense |
2321 | + the expense lines belong to''' |
2322 | + for id in ids: |
2323 | + expense = self.pool.get('hr.expense.line').browse(cr, uid, id).expense_id |
2324 | + ret = super(hr_expense_line,self).unlink(cr, uid, ids, context) |
2325 | + self.update_sequences(cr, uid, expense, context) |
2326 | + return ret |
2327 | + |
2328 | + def create(self, cr, user, vals, context=None): |
2329 | + ''' Overwriting the create() method |
2330 | + to update the line numbers of the expense |
2331 | + the expense line belongs to''' |
2332 | + ret = super(hr_expense_line,self).create(cr, user, vals, context) |
2333 | + |
2334 | + if ('sequence' not in vals) or (vals.get('sequence')==0): |
2335 | + expense = self.pool.get('hr.expense.expense').browse(cr, user, vals['expense_id']) |
2336 | + self.update_sequences(cr, user, expense, context) |
2337 | + return ret |
2338 | + |
2339 | +hr_expense_line() |
2340 | + |
2341 | + |
2342 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2343 | |
2344 | === added file 'hr_expense_line_sequence/hr_expense_line_sequence.xml' |
2345 | --- hr_expense_line_sequence/hr_expense_line_sequence.xml 1970-01-01 00:00:00 +0000 |
2346 | +++ hr_expense_line_sequence/hr_expense_line_sequence.xml 2013-08-12 22:45:40 +0000 |
2347 | @@ -0,0 +1,14 @@ |
2348 | +<openerp> |
2349 | + <data> |
2350 | + <record id="view_expenses_tree" model="ir.ui.view"> |
2351 | + <field name="name">hr.expense.line.tree.inherit</field> |
2352 | + <field name="model">hr.expense.line</field> |
2353 | + <field name="inherit_id" ref="hr_expense.view_expenses_line_tree"/> |
2354 | + <field name="arch" type="xml"> |
2355 | + <field name="date_value" position="before"> |
2356 | + <field name="sequence"/> |
2357 | + </field> |
2358 | + </field> |
2359 | + </record> |
2360 | + </data> |
2361 | +</openerp> |
2362 | |
2363 | === added directory 'hr_expense_line_sequence/i18n' |
2364 | === added file 'hr_expense_line_sequence/i18n/fr.po' |
2365 | --- hr_expense_line_sequence/i18n/fr.po 1970-01-01 00:00:00 +0000 |
2366 | +++ hr_expense_line_sequence/i18n/fr.po 2013-08-12 22:45:40 +0000 |
2367 | @@ -0,0 +1,22 @@ |
2368 | +# Translation of OpenERP Server. |
2369 | +# This file contains the translation of the following modules: |
2370 | +# * hr_expense_line_sequence |
2371 | +# |
2372 | +msgid "" |
2373 | +msgstr "" |
2374 | +"Project-Id-Version: OpenERP Server 6.1\n" |
2375 | +"Report-Msgid-Bugs-To: \n" |
2376 | +"POT-Creation-Date: 2013-07-19 19:40+0000\n" |
2377 | +"PO-Revision-Date: 2013-07-19 19:40+0000\n" |
2378 | +"Last-Translator: <>\n" |
2379 | +"Language-Team: \n" |
2380 | +"MIME-Version: 1.0\n" |
2381 | +"Content-Type: text/plain; charset=UTF-8\n" |
2382 | +"Content-Transfer-Encoding: \n" |
2383 | +"Plural-Forms: \n" |
2384 | + |
2385 | +#. module: hr_expense_line_sequence |
2386 | +#: model:ir.model,name:hr_expense_line_sequence.model_hr_expense_line |
2387 | +msgid "Expense Line" |
2388 | +msgstr "Ligne de frais" |
2389 | + |
2390 | |
2391 | === added file 'hr_expense_line_sequence/i18n/hr_expense_line_sequence.pot' |
2392 | --- hr_expense_line_sequence/i18n/hr_expense_line_sequence.pot 1970-01-01 00:00:00 +0000 |
2393 | +++ hr_expense_line_sequence/i18n/hr_expense_line_sequence.pot 2013-08-12 22:45:40 +0000 |
2394 | @@ -0,0 +1,22 @@ |
2395 | +# Translation of OpenERP Server. |
2396 | +# This file contains the translation of the following modules: |
2397 | +# * hr_expense_line_sequence |
2398 | +# |
2399 | +msgid "" |
2400 | +msgstr "" |
2401 | +"Project-Id-Version: OpenERP Server 6.1\n" |
2402 | +"Report-Msgid-Bugs-To: \n" |
2403 | +"POT-Creation-Date: 2013-07-19 19:40+0000\n" |
2404 | +"PO-Revision-Date: 2013-07-19 19:40+0000\n" |
2405 | +"Last-Translator: <>\n" |
2406 | +"Language-Team: \n" |
2407 | +"MIME-Version: 1.0\n" |
2408 | +"Content-Type: text/plain; charset=UTF-8\n" |
2409 | +"Content-Transfer-Encoding: \n" |
2410 | +"Plural-Forms: \n" |
2411 | + |
2412 | +#. module: hr_expense_line_sequence |
2413 | +#: model:ir.model,name:hr_expense_line_sequence.model_hr_expense_line |
2414 | +msgid "Expense Line" |
2415 | +msgstr "" |
2416 | + |
2417 | |
2418 | === added directory 'hr_expense_line_supplier_tax' |
2419 | === added file 'hr_expense_line_supplier_tax/__init__.py' |
2420 | --- hr_expense_line_supplier_tax/__init__.py 1970-01-01 00:00:00 +0000 |
2421 | +++ hr_expense_line_supplier_tax/__init__.py 2013-08-12 22:45:40 +0000 |
2422 | @@ -0,0 +1,22 @@ |
2423 | +# -*- encoding: utf-8 -*- |
2424 | +############################################################################## |
2425 | +#···· |
2426 | +# OpenERP, Open Source Management Solution |
2427 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2428 | +# |
2429 | +# This program is free software: you can redistribute it and/or modify |
2430 | +# it under the terms of the GNU General Public License as |
2431 | +# published by the Free Software Foundation, either version 3 of the |
2432 | +# License, or (at your option) any later version. |
2433 | +# |
2434 | +# This program is distributed in the hope that it will be useful, |
2435 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2436 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2437 | +# GNU General Public License for more details. |
2438 | +# |
2439 | +# You should have received a copy of the GNU General Public License |
2440 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
2441 | +# |
2442 | +############################################################################## |
2443 | +import hr_expense_line_supplier_tax |
2444 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2445 | |
2446 | === added file 'hr_expense_line_supplier_tax/__openerp__.py' |
2447 | --- hr_expense_line_supplier_tax/__openerp__.py 1970-01-01 00:00:00 +0000 |
2448 | +++ hr_expense_line_supplier_tax/__openerp__.py 2013-08-12 22:45:40 +0000 |
2449 | @@ -0,0 +1,39 @@ |
2450 | +# -*- encoding: utf-8 -*- |
2451 | +############################################################################## |
2452 | +#···· |
2453 | +# OpenERP, Open Source Management Solution |
2454 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2455 | +# |
2456 | +# This program is free software: you can redistribute it and/or modify |
2457 | +# it under the terms of the GNU General Public License as |
2458 | +# published by the Free Software Foundation, either version 3 of the |
2459 | +# License, or (at your option) any later version. |
2460 | +# |
2461 | +# This program is distributed in the hope that it will be useful, |
2462 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2463 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2464 | +# GNU General Public License for more details. |
2465 | +# |
2466 | +# You should have received a copy of the GNU General Public License |
2467 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
2468 | +# |
2469 | +############################################################################## |
2470 | +{ |
2471 | + "name" : "Supplier tax id on hr.expense.line", |
2472 | + "version" : "1.0", |
2473 | + "author" : "Savoir-faire Linux", |
2474 | + "website" : "http://www.savoirfairelinux.com", |
2475 | + "category" : "Human Resources", |
2476 | + "description": """ |
2477 | + This module adds the supplier tax id field to hr.expense.line |
2478 | + """, |
2479 | + "depends" : ['hr_expense', 'hr_expense_line_supplier'], |
2480 | + "init_xml" : [], |
2481 | + "update_xml" : [ |
2482 | + 'hr_expense_line_supplier_tax.xml', |
2483 | + ], |
2484 | + "demo_xml" : [], |
2485 | + "installable" : True, |
2486 | + "certificate" : '' |
2487 | +} |
2488 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2489 | |
2490 | === added file 'hr_expense_line_supplier_tax/hr_expense_line_supplier_tax.py' |
2491 | --- hr_expense_line_supplier_tax/hr_expense_line_supplier_tax.py 1970-01-01 00:00:00 +0000 |
2492 | +++ hr_expense_line_supplier_tax/hr_expense_line_supplier_tax.py 2013-08-12 22:45:40 +0000 |
2493 | @@ -0,0 +1,97 @@ |
2494 | +# -*- encoding: utf-8 -*- |
2495 | +############################################################################## |
2496 | +#···· |
2497 | +# OpenERP, Open Source Management Solution |
2498 | +# Copyright (C) 2010 Savoir-faire Linux (<http://www.savoirfairelinux.com>). |
2499 | +# |
2500 | +# This program is free software: you can redistribute it and/or modify |
2501 | +# it under the terms of the GNU General Public License as |
2502 | +# published by the Free Software Foundation, either version 3 of the |
2503 | +# License, or (at your option) any later version. |
2504 | +# |
2505 | +# This program is distributed in the hope that it will be useful, |
2506 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
2507 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
2508 | +# GNU General Public License for more details. |
2509 | +# |
2510 | +# You should have received a copy of the GNU General Public License |
2511 | +# along with this program. If not, see <http://www.gnu.org/licenses/>.····· |
2512 | +# |
2513 | +############################################################################## |
2514 | + |
2515 | +from osv import osv, fields |
2516 | +import decimal_precision as dp |
2517 | + |
2518 | +class hr_expense_line(osv.osv): |
2519 | + _inherit = 'hr.expense.line' |
2520 | + |
2521 | + |
2522 | + def get_tax_id(self, cr, uid, product_id, partner_id, context=None): |
2523 | + ''' |
2524 | + Get the automatic value of the tax id field. |
2525 | + ''' |
2526 | + product = self.pool.get('product.product').browse(cr, uid, product_id) |
2527 | + purch_tax = product.product_tmpl_id.supplier_taxes_id |
2528 | + |
2529 | + if purch_tax: |
2530 | + # Use the default purchase tax set on the product |
2531 | + defaut_tax = purch_tax[0] |
2532 | + |
2533 | + # Get the fiscal position of the supplier |
2534 | + supplier= self.pool.get('res.partner').browse(cr, uid, partner_id) |
2535 | + acc_pos = supplier.property_account_position |
2536 | + |
2537 | + # Apply the fiscal position mapping rules |
2538 | + if acc_pos.tax_ids: |
2539 | + for tax in acc_pos.tax_ids: |
2540 | + if tax.tax_src_id == defaut_tax: |
2541 | + defaut_tax = tax.tax_dest_id |
2542 | + break |
2543 | + return defaut_tax.id |
2544 | + |
2545 | + return None |
2546 | + |
2547 | + |
2548 | + def create(self, cr, user, vals, context=None): |
2549 | + ''' |
2550 | + Overwrite the create() function to automatically set the default supplier tax |
2551 | + since regular employees cannot access this field. |
2552 | + ''' |
2553 | + vals['tax_id'] = self.get_tax_id(cr, user, vals['product_id'], vals['partner_id'], context) |
2554 | + return super(hr_expense_line,self).create(cr, user, vals, context) |
2555 | + |
2556 | + |
2557 | + def onchange_product_id(self, cr, uid, ids, product_id, uom_id, employee_id, context=None): |
2558 | + if product_id: |
2559 | + values = super(hr_expense_line, self).onchange_product_id(cr, uid, ids, product_id, uom_id, employee_id, context=context) |
2560 | + else: |
2561 | + values = {} |
2562 | + |
2563 | + for id in ids: |
2564 | + this = self.browse(cr, uid, id) |
2565 | + if this.name: |
2566 | + tax_id = self.get_tax_id(cr, uid, product_id, this.partner_id.id, context) |
2567 | + values['value'].update({ |
2568 | + 'tax_id' : tax_id |
2569 | + }) |
2570 | + return values |
2571 | + |
2572 | + def onchange_partner_id(self, cr, uid, ids, partner_id, context=None): |
2573 | + if partner_id: |
2574 | + values = {'value': {}} |
2575 | + for id in ids: |
2576 | + this = self.browse(cr, uid, id) |
2577 | + tax_id = self.get_tax_id(cr, uid, this.product_id.id, partner_id, context) |
2578 | + values['value'].update({ |
2579 | + 'tax_id' : tax_id |
2580 | + }) |
2581 | + return values |
2582 | + |
2583 | + _columns = { |
2584 | + 'tax_id': fields.many2one('account.tax', 'Tax', domain=[('type_tax_use', '=', 'purchase')]), |
2585 | + 'partner_id': fields.many2one('res.partner', 'Supplier', required=True), |
2586 | + } |
2587 | + |
2588 | +hr_expense_line() |
2589 | + |
2590 | +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: |
2591 | |
2592 | === added file 'hr_expense_line_supplier_tax/hr_expense_line_supplier_tax.xml' |
2593 | --- hr_expense_line_supplier_tax/hr_expense_line_supplier_tax.xml 1970-01-01 00:00:00 +0000 |
2594 | +++ hr_expense_line_supplier_tax/hr_expense_line_supplier_tax.xml 2013-08-12 22:45:40 +0000 |
2595 | @@ -0,0 +1,30 @@ |
2596 | +<?xml version="1.0" encoding="utf-8"?> |
2597 | +<openerp> |
2598 | + <data> |
2599 | + <record id="view_expenses_tree" model="ir.ui.view"> |
2600 | + <field name="name">hr.expense.line.tree</field> |
2601 | + <field name="model">hr.expense.line</field> |
2602 | + <field name="inherit_id" ref="hr_expense.view_expenses_line_tree"/> |
2603 | + <field name="arch" type="xml"> |
2604 | + <field name="unit_amount" position="before"> |
2605 | + <field name="tax_id" groups="account.group_account_invoice"/> |
2606 | + </field> |
2607 | + </field> |
2608 | + </record> |
2609 | + |
2610 | + <record id="view_expenses_form" model="ir.ui.view"> |
2611 | + <field name="name">hr.expense.form</field> |
2612 | + <field name="model">hr.expense.expense</field> |
2613 | + <field name="inherit_id" ref="hr_expense_line_supplier.view_expenses_form"/> |
2614 | + <field name="arch" type="xml"> |
2615 | + <field name="partner_id" position="attributes"> |
2616 | + <attribute name="on_change">onchange_partner_id(partner_id)</attribute> |
2617 | + </field> |
2618 | + |
2619 | + <field name="uom_id" position="before"> |
2620 | + <field name="tax_id" groups="account.group_account_invoice"/> |
2621 | + </field> |
2622 | + </field> |
2623 | + </record> |
2624 | + </data> |
2625 | +</openerp> |
2626 | |
2627 | === added directory 'hr_expense_line_supplier_tax/i18n' |
2628 | === added file 'hr_expense_line_supplier_tax/i18n/fr.po' |
2629 | --- hr_expense_line_supplier_tax/i18n/fr.po 1970-01-01 00:00:00 +0000 |
2630 | +++ hr_expense_line_supplier_tax/i18n/fr.po 2013-08-12 22:45:40 +0000 |
2631 | @@ -0,0 +1,27 @@ |
2632 | +# Translation of OpenERP Server. |
2633 | +# This file contains the translation of the following modules: |
2634 | +# * hr_expense_line_supplier_tax |
2635 | +# |
2636 | +msgid "" |
2637 | +msgstr "" |
2638 | +"Project-Id-Version: OpenERP Server 6.1\n" |
2639 | +"Report-Msgid-Bugs-To: \n" |
2640 | +"POT-Creation-Date: 2013-07-19 19:41+0000\n" |
2641 | +"PO-Revision-Date: 2013-07-19 19:41+0000\n" |
2642 | +"Last-Translator: <>\n" |
2643 | +"Language-Team: \n" |
2644 | +"MIME-Version: 1.0\n" |
2645 | +"Content-Type: text/plain; charset=UTF-8\n" |
2646 | +"Content-Transfer-Encoding: \n" |
2647 | +"Plural-Forms: \n" |
2648 | + |
2649 | +#. module: hr_expense_line_supplier_tax |
2650 | +#: field:hr.expense.line,tax_id:0 |
2651 | +msgid "Tax" |
2652 | +msgstr "Taxe" |
2653 | + |
2654 | +#. module: hr_expense_line_supplier_tax |
2655 | +#: model:ir.model,name:hr_expense_line_supplier_tax.model_hr_expense_line |
2656 | +msgid "Expense Line" |
2657 | +msgstr "Ligne de frais" |
2658 | + |
2659 | |
2660 | === added file 'hr_expense_line_supplier_tax/i18n/hr_expense_line_supplier_tax.pot' |
2661 | --- hr_expense_line_supplier_tax/i18n/hr_expense_line_supplier_tax.pot 1970-01-01 00:00:00 +0000 |
2662 | +++ hr_expense_line_supplier_tax/i18n/hr_expense_line_supplier_tax.pot 2013-08-12 22:45:40 +0000 |
2663 | @@ -0,0 +1,27 @@ |
2664 | +# Translation of OpenERP Server. |
2665 | +# This file contains the translation of the following modules: |
2666 | +# * hr_expense_line_supplier_tax |
2667 | +# |
2668 | +msgid "" |
2669 | +msgstr "" |
2670 | +"Project-Id-Version: OpenERP Server 6.1\n" |
2671 | +"Report-Msgid-Bugs-To: \n" |
2672 | +"POT-Creation-Date: 2013-07-19 19:41+0000\n" |
2673 | +"PO-Revision-Date: 2013-07-19 19:41+0000\n" |
2674 | +"Last-Translator: <>\n" |
2675 | +"Language-Team: \n" |
2676 | +"MIME-Version: 1.0\n" |
2677 | +"Content-Type: text/plain; charset=UTF-8\n" |
2678 | +"Content-Transfer-Encoding: \n" |
2679 | +"Plural-Forms: \n" |
2680 | + |
2681 | +#. module: hr_expense_line_supplier_tax |
2682 | +#: field:hr.expense.line,tax_id:0 |
2683 | +msgid "Tax" |
2684 | +msgstr "" |
2685 | + |
2686 | +#. module: hr_expense_line_supplier_tax |
2687 | +#: model:ir.model,name:hr_expense_line_supplier_tax.model_hr_expense_line |
2688 | +msgid "Expense Line" |
2689 | +msgstr "" |
2690 | + |
hr_expense_ accountedge/ hr_expense_ accountedge. py [957]
It's better to search for the exact tax external reference or have a field linking the taxes that you need. And the module l10n_ca should be listed as a dependence in your __openerp__.py.