From 092390e4354579eef914e708b5b3e51a76cbbd5d Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Sat, 31 Jan 2015 03:21:03 +0100 Subject: [PATCH 01/44] [ADD] hr_expense_sequence: Module for giving each expense a number --- hr_expense_sequence/README.rst | 35 ++++++++++++ hr_expense_sequence/__init__.py | 17 ++++++ hr_expense_sequence/__openerp__.py | 39 +++++++++++++ hr_expense_sequence/data/hr_expense_data.xml | 18 ++++++ hr_expense_sequence/i18n/es.po | 28 +++++++++ .../i18n/hr_expense_sequence.pot | 28 +++++++++ hr_expense_sequence/models/__init__.py | 6 ++ .../models/hr_expense_expense.py | 18 ++++++ .../static/description/icon.png | Bin 0 -> 4849 bytes .../views/hr_expense_expense_view.xml | 53 ++++++++++++++++++ 10 files changed, 242 insertions(+) create mode 100644 hr_expense_sequence/README.rst create mode 100644 hr_expense_sequence/__init__.py create mode 100644 hr_expense_sequence/__openerp__.py create mode 100644 hr_expense_sequence/data/hr_expense_data.xml create mode 100644 hr_expense_sequence/i18n/es.po create mode 100644 hr_expense_sequence/i18n/hr_expense_sequence.pot create mode 100644 hr_expense_sequence/models/__init__.py create mode 100644 hr_expense_sequence/models/hr_expense_expense.py create mode 100644 hr_expense_sequence/static/description/icon.png create mode 100644 hr_expense_sequence/views/hr_expense_expense_view.xml diff --git a/hr_expense_sequence/README.rst b/hr_expense_sequence/README.rst new file mode 100644 index 000000000..12149c8e4 --- /dev/null +++ b/hr_expense_sequence/README.rst @@ -0,0 +1,35 @@ +Sequence for HR expense +======================= + +This module gives a unique number for each HR expense declaration. + +Configuration +============= + +You can change the default sequence (EX0000...) by the one of your choice +going to Settings > Technical > Sequences & Identifiers > Sequences, and +editing _HR expense_ record. + +You will only have access to that section if your section has _Technical +features_ permission check marked. + +Credits +======= + +Contributors +------------ + +* Pedro M. Baeza + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/hr_expense_sequence/__init__.py b/hr_expense_sequence/__init__.py new file mode 100644 index 000000000..f856b9648 --- /dev/null +++ b/hr_expense_sequence/__init__.py @@ -0,0 +1,17 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import models +from openerp import SUPERUSER_ID + + +def assign_old_sequences(cr, registry): + expense_obj = registry['hr.expense.expense'] + sequence_obj = registry['ir.sequence'] + expense_ids = expense_obj.search(cr, SUPERUSER_ID, [], order="id") + for expense_id in expense_ids: + expense_obj.write(cr, SUPERUSER_ID, expense_id, + {'number': sequence_obj.get( + cr, SUPERUSER_ID, 'hr.expense')}) diff --git a/hr_expense_sequence/__openerp__.py b/hr_expense_sequence/__openerp__.py new file mode 100644 index 000000000..eeaa20531 --- /dev/null +++ b/hr_expense_sequence/__openerp__.py @@ -0,0 +1,39 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Odoo Source Management Solution +# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Pedro M. Baeza +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name': 'HR expense sequence', + 'version': '1.0', + 'category': 'HR', + 'author': 'Serv. Tecnol. Avanzados - Pedro M. Baeza', + 'website': 'http://www.serviciosbaeza.com', + 'depends': [ + 'hr_expense', + ], + 'data': [ + 'data/hr_expense_data.xml', + 'views/hr_expense_expense_view.xml', + ], + "installable": True, + "post_init_hook": "assign_old_sequences", +} + diff --git a/hr_expense_sequence/data/hr_expense_data.xml b/hr_expense_sequence/data/hr_expense_data.xml new file mode 100644 index 000000000..8c0f3789c --- /dev/null +++ b/hr_expense_sequence/data/hr_expense_data.xml @@ -0,0 +1,18 @@ + + + + + + Expense sequence + hr.expense + + + + Expense sequence + hr.expense + + EX + + + + \ No newline at end of file diff --git a/hr_expense_sequence/i18n/es.po b/hr_expense_sequence/i18n/es.po new file mode 100644 index 000000000..47ab5ed01 --- /dev/null +++ b/hr_expense_sequence/i18n/es.po @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-01-31 01:53+0000\n" +"PO-Revision-Date: 2015-01-31 01:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense +msgid "Expense" +msgstr "Gasto" + +#. module: hr_expense_sequence +#: field:hr.expense.expense,number:0 +msgid "Number" +msgstr "Número" + diff --git a/hr_expense_sequence/i18n/hr_expense_sequence.pot b/hr_expense_sequence/i18n/hr_expense_sequence.pot new file mode 100644 index 000000000..39c92eeed --- /dev/null +++ b/hr_expense_sequence/i18n/hr_expense_sequence.pot @@ -0,0 +1,28 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-01-31 01:53+0000\n" +"PO-Revision-Date: 2015-01-31 01:53+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense +msgid "Expense" +msgstr "" + +#. module: hr_expense_sequence +#: field:hr.expense.expense,number:0 +msgid "Number" +msgstr "" + diff --git a/hr_expense_sequence/models/__init__.py b/hr_expense_sequence/models/__init__.py new file mode 100644 index 000000000..e70dab885 --- /dev/null +++ b/hr_expense_sequence/models/__init__.py @@ -0,0 +1,6 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from . import hr_expense_expense diff --git a/hr_expense_sequence/models/hr_expense_expense.py b/hr_expense_sequence/models/hr_expense_expense.py new file mode 100644 index 000000000..2786730dc --- /dev/null +++ b/hr_expense_sequence/models/hr_expense_expense.py @@ -0,0 +1,18 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# For copyright and license notices, see __openerp__.py file in root directory +############################################################################## + +from openerp import models, fields, api + + +class HrExpense(models.Model): + _inherit = 'hr.expense.expense' + + number = fields.Char(required=True, default="/", readonly=True) + + @api.model + def create(self, vals): + if vals.get('number', '/') == '/': + vals['number'] = self.env['ir.sequence'].get('hr.expense') + return super(HrExpense, self).create(vals) diff --git a/hr_expense_sequence/static/description/icon.png b/hr_expense_sequence/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..91af287db985e088831dde34dcb61d7844f00814 GIT binary patch literal 4849 zcmYK?2RM{}{O_H!*BNn6MnWBz5m}jq$jm%5StUnwG7o3(nMCF<=@40oj3^n|BP(aG zWUmm;|Ly<$pXdL4*YkYe&-2;q`^FgR-(jRf(g6U#sI8@L1fGO{i-ro^Ta_Plg9nwp z&K-5&{NKoLB0dLiXg#znZ~#Eh_HRLeSJ?>glG;mKPlI{}!Uv^hxIg0f9{{ihX{)Q5 z`2O6;3Ghf;YU)r4_-;ELZap3j*R6s}r0~NM-WbYN!Zq$VV#DlsiX!?de`QK384?dn z+KqEi*Dd8|J)E%wOL0%M{TGf3_82?D>mP=p!jrHNZ1ff>hLsWY7FZxIANW> zc-+@m?U#E9&O_zqt-S`ttp1=VSYRqk%g|KgzcJiln~4v)5wjOsseVxLy2Zg|5zL4fJJZI_l~$|EAnGF|5UG zm!X0fQ5uPM<6GqhW;E~$n6~G?TYwB_5*$eU5%F;|C~3)WZ=!xp$@ZwtK%z~f`q^PX zhJ8Wh&1}U_&hkM2>7N_9*45cQ%z?VbIIBA*O4l-Ln8i)oC6N1#mcGFE{ElUhD#a(t zTfCqkKK*gMYs;$2nu<;KNTSM zr%TD=6kfb^J$irtQ>t3O&sNWyc7sIG8lF7J67|3jQu~+J26C8vZQnwR$2Inp_4Q%n zS1%9iT1uA;;;0K)DM~H9Ww&_$Vo>6BQqOTqoFH2%ls?Y(IJtlgS0A|)hQGXK*}3~4 z96{o(v4F^n5_47r1J%4RBGY*&9!aYi0pO&F4zY1&x`B2h6d+#`KFeO@ppO@Utk&-{ z{pq5y8;{l4^IU&CSH70H?=q)B0BGx3|9dBtp>QwEpIs}Tr%c#t0Qsv>z<5S(cg6(%nRdr2Ie_zQf$i795~6Wn^}= zcsuu)J1@6c%k9h*>rFkgtLB`FqG}R@I%d+QXbP(%CEB#q)zz<7-YP|hVTtv6HKTlp z_w=IB&MLI@6umIwvV=i=i;L@}(OHLE;hMCkcw4^2k5ovkJIR)h=_My|@=n9>9j`Yj zZ^98qS2|K1UlGvV8I^k@HzFfomz*G>Kw#^tmywlK+~h|4+5r_0ZxXSi-@748ChDbk zRQxbe*w2W83nh%VWxg?HQiuON7M1!hP;+RH@IOXI<~-!;Q}V0l8&bb4?94t5_~bvO zv+#^>_=#kSW9*yh_dG_d@fZd}3?{nG{*tnCZUVO~RnBDX6F#YjeU8gLnNwXdS&Uh| znt1$aw5T|L^#s=JeO_K(d1ppWPQnCsGZ*5OYEfqPJS|P#)m7BZ%`KMuR~$o#K~6{5 z;H;2j`|Ut0`WuXHJ+B_WwzgI-)&aj3DZoWN%EF6RfeMu4y%pUfl*YOhb$GRL*CzB%gb)MDaO zj_-B8ohtYghf5JGHqU(0eCBOwX}RsI7|8nHmFt3QisLrC%FUQ0zo%#gl(&|aguRPh zP>^z#jNAOT7&dlJ&f)R#=n1UzN?*?1tk6)X(+G8PaZMs;g0G^hK6T z91b^8@qprrem0<*D(G}zRc3}nBCn#+->@JJ@`mHRd7j4`0o6lACHh$KV95P?hyZ!O&Oc~CF$KJ^k&H#8ye=9Zm+Ln zkw^vJEzliVSy@A^A*y)1;?B;_I9A5FFFOX*Kf5FeQ|-(M8i|;n4*=B@q=b9`)FA2E zn9be5hnc<3xa1y@7qJ-`i23<>2?PTjt^eg)=GWCVkl(cu|66($)?WW)pk(oW^WL0_ zL+dmp_U8xf%y<&XnvR|xB_<{;D{G!fV!NVW;WjDbGy*fT(blFtK0apW;20Vo@6_rh zWhN^9Ndf=oaVd!GVE%m|lqXDw6c<&p8BBX4d13tCfu8PDn_wZVqbdU!yDy7t~fucj3Q& zf>*xCL@oAG$ItKwpMZ(=r`Q^@LQ2Ze$@xxaDqnaFWwIdZ5vzaP?*L1;kRY25ggZ?4 zIKkS=z>P|v+OkYDRdC;5NuMZnRck$tp*Hi%J-?;Zjbn6ogE8%YEtXG;9A-ITasg z0s``f_XKYuj9Z$YkS*&0aV2Pm=@VPm4n(ZFa%kb4JTV;$w87Bu*U^Kw>N-n}iqr12 zhsee@+KN}9rKE(Zl2%NP*i`L)b;2tcLaN5r7|#>7k^vU{w@$amTcvV-)50MM^d70V5hLosww`_i*CU1wH5U@60)gO@ z*eavG?9=FM4V})67b6cjqo$ZtosQ*uTvoq*%Z&7_cpI3ULb}iO!Ur0c#Jjk2 z{_~p^1hlh<>_vBel0$(>KQ0OY;q;Nda@5Zgn2j+BhF z_~8ew{yR{A6_=_iPDA`YKdy>%)@xjXSU5aH3O^X4{QbDxPG5)kx-^ZiY(`F*2F~{I z>s*EB?38S!ZHXW#d#s8gOx5N4s=H{forHap7lbe_$F`!Q&&K`G$ZX9}02DXII2EPr z-&sB`8ap}2oj~W=@cP4|G|00_`ir3S1D}IftRejYpZcRs#w= z_i$1t&7n1xqbk)oIaV?ynj|QLwB=c2mB{+jO+!cI`xCBeixy_Gn==L#d`{b)??hL) zmC(+k9bGo-$)pDSulI&{#C1rwCdGK0lT_I$92No%1^#b3h|sX#44IQP_zI=rBsJb7EP&d=f(8qN=qjju$Ad4j!Vm(Aha{Yd zsp;V8X#37WM?+c9w{Pko`Qa4=n3~a6ALD=j{%t$?p|-Z#xfiLQtN1;hOUmE%BO``p zk%BYiCV}%521o!AEe!cC->L}BFEDpB0D(8*6K5A+Z1C=wcf#a6g4cE`P z{=ZQr@7{gy?q1kz*lJ(d^W6V+55&s#qtCr|Z%9Y{o}uBuu*AC%mmp}}>9ds()>$-s zt~`#C7dAbRD5McivD}+AR<=1Eu(eU${|UDu_jHj4Ed4Uw>47KW4zk$smh@{@zB_H4 zVLyF@G_GVr|M(aM0r!EGQ%^NOIE9jdLPS(FtP7bC*%rrnII$ugd`y4Sdz}UZ0@;-2 z;`(y`w$CT)CPq`raesNvkwUy07RE@C$g6}jA@})wzU}4Zm4`c6ukQb&kOx-V?Cgso zA|h$^R_>pi@^LEMzj_2jJun!;gH9^tzrP9~ndfBHf$L>-Q5^SBLKOYXJCi^4^-(Gcq!I;=ln(g2sg$kk5cN1mxs&$5`of) z=ZKAs4eerKVOd;Wj+9;oHLLU3)fF;c|7+2?a;x*8@NB1tjIPH9y}>qQN~|IxTHBY)tr`=<~~__7BceKX{5x|SCMxbzo)m^ zd`>ph*gL*_-Uq7_ux^n!Id5!ig!K2y&fr^PFNk_HOo1I~lHcC)Gj4}-@)^lzCQvI? zI^XfN&hhg;N)}jTG#J&dc6WD^dx9MtE`z;PXH^e1AAVqgtqpXxw9wGd5D`ARr^IFh zigQ*DJ4A1@KG9+DwZ>U)*4wwjW~CT46BG7`hzLPJLD)fAdHD(`yy9MuRO9wndWxJq zZTtzmlj0PsB^wHxEe}3(HI%<{g*fw0I{$Qc_bK?c@gaHM8Stx}EW3&adtUtc$&7j5 z4Qc7^;XHDhc=Ks$-S=UDHKbnbuCt~Jx%*109RVTw3f@#R zzg(U7B-rG1Vv?tU}ZRYS|^&5xMX$MTPw~GB$3I zi7RxVuAnW-UnuNnYavaiiCeb-gVWP}&kdBd!FPs}lM|STd|dY?9_Ceg%-tFq8p1UC zN+zk0eQRabM#~n43dzCc9;-uzZ{EPpz0R0}k8Xp(5^%V=bb8#s<4bbS=QrFAT$Jpg(LUZ=Dt$K;~w31%4?AmBy=y?kCEBNH<+@SsP&0##O{d6 srS=W)g&kk8a|ERz<0G`~*musk@CUFJmj-e0=M + + + + + hr.expense.expense.tree.sequence + hr.expense.expense + + + + + + + + + + hr.expense.expense.tree.sequence + hr.expense.expense + + + + + + + + + + hr.expense.form.sequence + hr.expense.expense + + + +

+

+
+
+
+ + + hr.expense.expense.filter.sequence + hr.expense.expense + + + + ['|', ('name', 'ilike', self), ('number', 'ilike', self)] + + + + +
+
\ No newline at end of file From ee126f1ab28fcafdb1c79ca764429b3d96e97b2a Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 3 Feb 2015 09:24:24 +0100 Subject: [PATCH 02/44] [FIX] hr_expense_sequence: Travis --- hr_expense_sequence/__openerp__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/hr_expense_sequence/__openerp__.py b/hr_expense_sequence/__openerp__.py index eeaa20531..539219b9a 100644 --- a/hr_expense_sequence/__openerp__.py +++ b/hr_expense_sequence/__openerp__.py @@ -36,4 +36,3 @@ "installable": True, "post_init_hook": "assign_old_sequences", } - From fa78e9797c3f7d6d24e6cd446d05aa941c7efeb7 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Mon, 2 Mar 2015 17:24:54 +0100 Subject: [PATCH 03/44] Add OCA as author of OCA addons In order to get visibility on https://www.odoo.com/apps the OCA board has decided to add the OCA as author of all the addons maintained as part of the association. --- hr_expense_sequence/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hr_expense_sequence/__openerp__.py b/hr_expense_sequence/__openerp__.py index 539219b9a..db07f5027 100644 --- a/hr_expense_sequence/__openerp__.py +++ b/hr_expense_sequence/__openerp__.py @@ -24,7 +24,7 @@ 'name': 'HR expense sequence', 'version': '1.0', 'category': 'HR', - 'author': 'Serv. Tecnol. Avanzados - Pedro M. Baeza', + 'author': "Serv. Tecnol. Avanzados - Pedro M. Baeza,Odoo Community Association (OCA)", 'website': 'http://www.serviciosbaeza.com', 'depends': [ 'hr_expense', From 6529d0a042077f3fb11a538259c691bd3a9ee64f Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Tue, 3 Mar 2015 14:41:56 +0100 Subject: [PATCH 04/44] fix travis (flake8) --- hr_expense_sequence/__openerp__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hr_expense_sequence/__openerp__.py b/hr_expense_sequence/__openerp__.py index db07f5027..a9a1584cc 100644 --- a/hr_expense_sequence/__openerp__.py +++ b/hr_expense_sequence/__openerp__.py @@ -24,7 +24,8 @@ 'name': 'HR expense sequence', 'version': '1.0', 'category': 'HR', - 'author': "Serv. Tecnol. Avanzados - Pedro M. Baeza,Odoo Community Association (OCA)", + 'author': "Serv. Tecnol. Avanzados - Pedro M. Baeza," + "Odoo Community Association (OCA)", 'website': 'http://www.serviciosbaeza.com', 'depends': [ 'hr_expense', From 1c99eb77f031a44229eb23fce266cb69772b4630 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 3 Apr 2015 12:25:51 +0200 Subject: [PATCH 05/44] Write expense number on account move --- hr_expense_sequence/models/hr_expense_expense.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hr_expense_sequence/models/hr_expense_expense.py b/hr_expense_sequence/models/hr_expense_expense.py index 2786730dc..c06c78445 100644 --- a/hr_expense_sequence/models/hr_expense_expense.py +++ b/hr_expense_sequence/models/hr_expense_expense.py @@ -16,3 +16,11 @@ def create(self, vals): if vals.get('number', '/') == '/': vals['number'] = self.env['ir.sequence'].get('hr.expense') return super(HrExpense, self).create(vals) + + @api.model + def account_move_get(self, expense_id): + '''Write expense number on account move''' + vals = super(HrExpense, self).account_move_get(expense_id) + expense = self.browse(expense_id) + vals['ref'] = expense.number + return vals From ec769752b8e298a9f44e0e7e997b43dcc3c927b3 Mon Sep 17 00:00:00 2001 From: Guewen Baconnier Date: Thu, 28 May 2015 11:45:22 +0200 Subject: [PATCH 06/44] Do not copy the expense sequence --- hr_expense_sequence/i18n/en.po | 34 ++++++++++++++++++ hr_expense_sequence/i18n/fr.po | 34 ++++++++++++++++++ hr_expense_sequence/i18n/sl.po | 35 +++++++++++++++++++ .../models/hr_expense_expense.py | 2 +- 4 files changed, 104 insertions(+), 1 deletion(-) create mode 100644 hr_expense_sequence/i18n/en.po create mode 100644 hr_expense_sequence/i18n/fr.po create mode 100644 hr_expense_sequence/i18n/sl.po diff --git a/hr_expense_sequence/i18n/en.po b/hr_expense_sequence/i18n/en.po new file mode 100644 index 000000000..743caa08e --- /dev/null +++ b/hr_expense_sequence/i18n/en.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: hr (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-18 13:10+0000\n" +"PO-Revision-Date: 2015-07-27 23:44+0000\n" +"Last-Translator: OCA Transbot \n" +"Language-Team: English (http://www.transifex.com/oca/OCA-hr-8-0/language/en/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: en\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense +msgid "Expense" +msgstr "Expense" + +#. module: hr_expense_sequence +#: field:hr.expense.expense,number:0 +msgid "Number" +msgstr "Number" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence +msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" +msgstr "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" diff --git a/hr_expense_sequence/i18n/fr.po b/hr_expense_sequence/i18n/fr.po new file mode 100644 index 000000000..6739fa4f4 --- /dev/null +++ b/hr_expense_sequence/i18n/fr.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +# Translators: +msgid "" +msgstr "" +"Project-Id-Version: hr (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-18 13:10+0000\n" +"PO-Revision-Date: 2015-07-27 23:44+0000\n" +"Last-Translator: <>\n" +"Language-Team: French (http://www.transifex.com/oca/OCA-hr-8-0/language/fr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense +msgid "Expense" +msgstr "Frais" + +#. module: hr_expense_sequence +#: field:hr.expense.expense,number:0 +msgid "Number" +msgstr "" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence +msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" +msgstr "" diff --git a/hr_expense_sequence/i18n/sl.po b/hr_expense_sequence/i18n/sl.po new file mode 100644 index 000000000..7fa7c6b23 --- /dev/null +++ b/hr_expense_sequence/i18n/sl.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +# Translators: +# Matjaž Mozetič , 2015 +msgid "" +msgstr "" +"Project-Id-Version: hr (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-08-18 13:10+0000\n" +"PO-Revision-Date: 2015-08-01 16:13+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-hr-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense +msgid "Expense" +msgstr "Izdatki" + +#. module: hr_expense_sequence +#: field:hr.expense.expense,number:0 +msgid "Number" +msgstr "Številka" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence +msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" +msgstr "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" diff --git a/hr_expense_sequence/models/hr_expense_expense.py b/hr_expense_sequence/models/hr_expense_expense.py index c06c78445..a5f2a1c69 100644 --- a/hr_expense_sequence/models/hr_expense_expense.py +++ b/hr_expense_sequence/models/hr_expense_expense.py @@ -9,7 +9,7 @@ class HrExpense(models.Model): _inherit = 'hr.expense.expense' - number = fields.Char(required=True, default="/", readonly=True) + number = fields.Char(required=True, default="/", readonly=True, copy=False) @api.model def create(self, vals): From 273f9f428a90395150f269a81f39bdabcfe484a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul?= Date: Fri, 9 Oct 2015 10:00:20 +0200 Subject: [PATCH 07/44] [UPD] prefix versions with 8.0 --- hr_expense_sequence/__openerp__.py | 2 +- hr_expense_sequence/i18n/de.po | 37 ++++++++++++++++++++++++++++++ hr_expense_sequence/i18n/fi.po | 35 ++++++++++++++++++++++++++++ hr_expense_sequence/i18n/it.po | 35 ++++++++++++++++++++++++++++ hr_expense_sequence/i18n/pt_BR.po | 35 ++++++++++++++++++++++++++++ 5 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 hr_expense_sequence/i18n/de.po create mode 100644 hr_expense_sequence/i18n/fi.po create mode 100644 hr_expense_sequence/i18n/it.po create mode 100644 hr_expense_sequence/i18n/pt_BR.po diff --git a/hr_expense_sequence/__openerp__.py b/hr_expense_sequence/__openerp__.py index a9a1584cc..8fa29f303 100644 --- a/hr_expense_sequence/__openerp__.py +++ b/hr_expense_sequence/__openerp__.py @@ -22,7 +22,7 @@ { 'name': 'HR expense sequence', - 'version': '1.0', + 'version': '8.0.1.0.0', 'category': 'HR', 'author': "Serv. Tecnol. Avanzados - Pedro M. Baeza," "Odoo Community Association (OCA)", diff --git a/hr_expense_sequence/i18n/de.po b/hr_expense_sequence/i18n/de.po new file mode 100644 index 000000000..d5409b173 --- /dev/null +++ b/hr_expense_sequence/i18n/de.po @@ -0,0 +1,37 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +# Translators: +# Rudolf Schnapka , 2016 +# Thomas A. Jaeger, 2015 +# Thomas A. Jaeger, 2015 +msgid "" +msgstr "" +"Project-Id-Version: hr (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-11-30 05:19+0000\n" +"PO-Revision-Date: 2016-01-26 09:44+0000\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-hr-8-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense +msgid "Expense" +msgstr "Aufwand" + +#. module: hr_expense_sequence +#: field:hr.expense.expense,number:0 +msgid "Number" +msgstr "Nummer" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence +msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" +msgstr "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" diff --git a/hr_expense_sequence/i18n/fi.po b/hr_expense_sequence/i18n/fi.po new file mode 100644 index 000000000..f1173ad89 --- /dev/null +++ b/hr_expense_sequence/i18n/fi.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +# Translators: +# Jarmo Kortetjärvi , 2016 +msgid "" +msgstr "" +"Project-Id-Version: hr (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-04-14 04:15+0000\n" +"PO-Revision-Date: 2016-04-04 11:09+0000\n" +"Last-Translator: Jarmo Kortetjärvi \n" +"Language-Team: Finnish (http://www.transifex.com/oca/OCA-hr-8-0/language/fi/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense +msgid "Expense" +msgstr "Kulu" + +#. module: hr_expense_sequence +#: field:hr.expense.expense,number:0 +msgid "Number" +msgstr "Numero" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence +msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" +msgstr "" diff --git a/hr_expense_sequence/i18n/it.po b/hr_expense_sequence/i18n/it.po new file mode 100644 index 000000000..2da87ddbe --- /dev/null +++ b/hr_expense_sequence/i18n/it.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +# Translators: +# Paolo Valier, 2016 +msgid "" +msgstr "" +"Project-Id-Version: hr (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-12 12:02+0000\n" +"PO-Revision-Date: 2016-03-19 10:39+0000\n" +"Last-Translator: Paolo Valier\n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-hr-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense +msgid "Expense" +msgstr "" + +#. module: hr_expense_sequence +#: field:hr.expense.expense,number:0 +msgid "Number" +msgstr "Numero" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence +msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" +msgstr "" diff --git a/hr_expense_sequence/i18n/pt_BR.po b/hr_expense_sequence/i18n/pt_BR.po new file mode 100644 index 000000000..220b8719e --- /dev/null +++ b/hr_expense_sequence/i18n/pt_BR.po @@ -0,0 +1,35 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +# Translators: +# danimaribeiro , 2016 +msgid "" +msgstr "" +"Project-Id-Version: hr (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-03-11 01:48+0000\n" +"PO-Revision-Date: 2016-03-08 03:18+0000\n" +"Last-Translator: danimaribeiro \n" +"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-hr-8-0/language/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense +msgid "Expense" +msgstr "Despesa" + +#. module: hr_expense_sequence +#: field:hr.expense.expense,number:0 +msgid "Number" +msgstr "Número" + +#. module: hr_expense_sequence +#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence +msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" +msgstr "" From dc2e385b4f8780c8ec0093526ef4e388c518a74e Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Tue, 5 Jul 2016 20:19:28 +0200 Subject: [PATCH 08/44] [MIG] Make modules uninstallable --- hr_expense_sequence/__openerp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hr_expense_sequence/__openerp__.py b/hr_expense_sequence/__openerp__.py index 8fa29f303..7f00a5a24 100644 --- a/hr_expense_sequence/__openerp__.py +++ b/hr_expense_sequence/__openerp__.py @@ -34,6 +34,6 @@ 'data/hr_expense_data.xml', 'views/hr_expense_expense_view.xml', ], - "installable": True, + 'installable': False, "post_init_hook": "assign_old_sequences", } From 94f21987a346ad8baf3c1ad972cd9beadf0c96c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Mon, 15 Aug 2016 22:13:29 +0200 Subject: [PATCH 09/44] [FIX] remove en.po that was erroneously created by transbot --- hr_expense_sequence/i18n/en.po | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 hr_expense_sequence/i18n/en.po diff --git a/hr_expense_sequence/i18n/en.po b/hr_expense_sequence/i18n/en.po deleted file mode 100644 index 743caa08e..000000000 --- a/hr_expense_sequence/i18n/en.po +++ /dev/null @@ -1,34 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * hr_expense_sequence -# -# Translators: -msgid "" -msgstr "" -"Project-Id-Version: hr (8.0)\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-08-18 13:10+0000\n" -"PO-Revision-Date: 2015-07-27 23:44+0000\n" -"Last-Translator: OCA Transbot \n" -"Language-Team: English (http://www.transifex.com/oca/OCA-hr-8-0/language/en/)\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Language: en\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" - -#. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence -#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense -msgid "Expense" -msgstr "Expense" - -#. module: hr_expense_sequence -#: field:hr.expense.expense,number:0 -msgid "Number" -msgstr "Number" - -#. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence -msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" -msgstr "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" From a031dd8dc81180aabbe64a5447614321073f4d36 Mon Sep 17 00:00:00 2001 From: "Pedro M. Baeza" Date: Thu, 6 Oct 2016 14:52:24 +0200 Subject: [PATCH 10/44] [MIG] Rename manifest files --- hr_expense_sequence/{__openerp__.py => __manifest__.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename hr_expense_sequence/{__openerp__.py => __manifest__.py} (100%) diff --git a/hr_expense_sequence/__openerp__.py b/hr_expense_sequence/__manifest__.py similarity index 100% rename from hr_expense_sequence/__openerp__.py rename to hr_expense_sequence/__manifest__.py From 6bfa435e4e7674ade15baa451cd43a2faf136d0b Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 6 Jun 2017 21:13:55 +0200 Subject: [PATCH 11/44] Port hr_expense_sequence to v10 --- hr_expense_sequence/README.rst | 42 ++++++++--- hr_expense_sequence/__init__.py | 21 +++--- hr_expense_sequence/__manifest__.py | 28 ++----- hr_expense_sequence/data/hr_expense_data.xml | 23 ++---- hr_expense_sequence/models/__init__.py | 7 +- .../models/hr_expense_expense.py | 26 ------- .../models/hr_expense_sheet.py | 19 +++++ .../report/report_expense_sheet.xml | 10 +++ .../views/hr_expense_expense_view.xml | 74 ++++++++----------- 9 files changed, 115 insertions(+), 135 deletions(-) delete mode 100644 hr_expense_sequence/models/hr_expense_expense.py create mode 100644 hr_expense_sequence/models/hr_expense_sheet.py create mode 100644 hr_expense_sequence/report/report_expense_sheet.xml diff --git a/hr_expense_sequence/README.rst b/hr_expense_sequence/README.rst index 12149c8e4..f90abcfeb 100644 --- a/hr_expense_sequence/README.rst +++ b/hr_expense_sequence/README.rst @@ -1,18 +1,38 @@ -Sequence for HR expense -======================= +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 -This module gives a unique number for each HR expense declaration. +============================ +Sequence for Expense Reports +============================ + +This module gives a unique number for each *Expense Report* (object *hr.expense.sheet*). Configuration ============= -You can change the default sequence (EX0000...) by the one of your choice -going to Settings > Technical > Sequences & Identifiers > Sequences, and -editing _HR expense_ record. +You can change the default sequence (EX0001) by the one of your choice +going to *Settings > Technical > Sequences & Identifiers > Sequences*, and +editing the record _Expense Report sequence_. You will only have access to that section if your section has _Technical features_ permission check marked. +Usage +===== + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/116/10.0 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. + Credits ======= @@ -24,12 +44,14 @@ Contributors Maintainer ---------- -.. image:: http://odoo-community.org/logo.png +.. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association - :target: http://odoo-community.org + :target: https://odoo-community.org This module is maintained by the OCA. -OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. diff --git a/hr_expense_sequence/__init__.py b/hr_expense_sequence/__init__.py index f856b9648..306e39eea 100644 --- a/hr_expense_sequence/__init__.py +++ b/hr_expense_sequence/__init__.py @@ -1,17 +1,14 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# -*- coding: utf-8 -*- from . import models -from openerp import SUPERUSER_ID +from odoo import api, SUPERUSER_ID def assign_old_sequences(cr, registry): - expense_obj = registry['hr.expense.expense'] - sequence_obj = registry['ir.sequence'] - expense_ids = expense_obj.search(cr, SUPERUSER_ID, [], order="id") - for expense_id in expense_ids: - expense_obj.write(cr, SUPERUSER_ID, expense_id, - {'number': sequence_obj.get( - cr, SUPERUSER_ID, 'hr.expense')}) + with api.Environment.manage(): + env = api.Environment(cr, SUPERUSER_ID, {}) + expense_obj = env['hr.expense.sheet'] + sequence_obj = env['ir.sequence'] + for expense in expense_obj.search([], order='id'): + expense.write({ + 'number': sequence_obj.next_by_code('hr.expense.sheet')}) diff --git a/hr_expense_sequence/__manifest__.py b/hr_expense_sequence/__manifest__.py index 7f00a5a24..a37757f8b 100644 --- a/hr_expense_sequence/__manifest__.py +++ b/hr_expense_sequence/__manifest__.py @@ -1,28 +1,11 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Odoo Source Management Solution -# Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# -*- coding: utf-8 -*- +# © 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'HR expense sequence', - 'version': '8.0.1.0.0', + 'version': '10.0.1.0.0', 'category': 'HR', 'author': "Serv. Tecnol. Avanzados - Pedro M. Baeza," "Odoo Community Association (OCA)", @@ -33,7 +16,8 @@ 'data': [ 'data/hr_expense_data.xml', 'views/hr_expense_expense_view.xml', + 'report/report_expense_sheet.xml', ], - 'installable': False, + 'installable': True, "post_init_hook": "assign_old_sequences", } diff --git a/hr_expense_sequence/data/hr_expense_data.xml b/hr_expense_sequence/data/hr_expense_data.xml index 8c0f3789c..12ec5a0b2 100644 --- a/hr_expense_sequence/data/hr_expense_data.xml +++ b/hr_expense_sequence/data/hr_expense_data.xml @@ -1,18 +1,11 @@ - - + - - Expense sequence - hr.expense - + + Expense report sequence + hr.expense.sheet + + EX + - - Expense sequence - hr.expense - - EX - - - - \ No newline at end of file + diff --git a/hr_expense_sequence/models/__init__.py b/hr_expense_sequence/models/__init__.py index e70dab885..60078d06c 100644 --- a/hr_expense_sequence/models/__init__.py +++ b/hr_expense_sequence/models/__init__.py @@ -1,6 +1,3 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## +# -*- coding: utf-8 -*- -from . import hr_expense_expense +from . import hr_expense_sheet diff --git a/hr_expense_sequence/models/hr_expense_expense.py b/hr_expense_sequence/models/hr_expense_expense.py deleted file mode 100644 index a5f2a1c69..000000000 --- a/hr_expense_sequence/models/hr_expense_expense.py +++ /dev/null @@ -1,26 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# For copyright and license notices, see __openerp__.py file in root directory -############################################################################## - -from openerp import models, fields, api - - -class HrExpense(models.Model): - _inherit = 'hr.expense.expense' - - number = fields.Char(required=True, default="/", readonly=True, copy=False) - - @api.model - def create(self, vals): - if vals.get('number', '/') == '/': - vals['number'] = self.env['ir.sequence'].get('hr.expense') - return super(HrExpense, self).create(vals) - - @api.model - def account_move_get(self, expense_id): - '''Write expense number on account move''' - vals = super(HrExpense, self).account_move_get(expense_id) - expense = self.browse(expense_id) - vals['ref'] = expense.number - return vals diff --git a/hr_expense_sequence/models/hr_expense_sheet.py b/hr_expense_sequence/models/hr_expense_sheet.py new file mode 100644 index 000000000..4e2645ff8 --- /dev/null +++ b/hr_expense_sequence/models/hr_expense_sheet.py @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# © 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models, fields, api + + +class HrExpenseSheet(models.Model): + _inherit = 'hr.expense.sheet' + + number = fields.Char(required=True, default="/", readonly=True, copy=False) + + @api.model + def create(self, vals): + if vals.get('number', '/') == '/': + number = self.env['ir.sequence'].next_by_code('hr.expense.sheet') + vals['number'] = number + return super(HrExpenseSheet, self).create(vals) diff --git a/hr_expense_sequence/report/report_expense_sheet.xml b/hr_expense_sequence/report/report_expense_sheet.xml new file mode 100644 index 000000000..39cba7100 --- /dev/null +++ b/hr_expense_sequence/report/report_expense_sheet.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/hr_expense_sequence/views/hr_expense_expense_view.xml b/hr_expense_sequence/views/hr_expense_expense_view.xml index e0f14513c..a81ae20f7 100644 --- a/hr_expense_sequence/views/hr_expense_expense_view.xml +++ b/hr_expense_sequence/views/hr_expense_expense_view.xml @@ -1,53 +1,37 @@ - - + - - hr.expense.expense.tree.sequence - hr.expense.expense - - - - - + + hr.expense.sheet.tree.sequence + hr.expense.sheet + + + + - + + - - hr.expense.expense.tree.sequence - hr.expense.expense - - - - - + + hr.expense.sheet.form.sequence + hr.expense.sheet + + + + - + + - - hr.expense.form.sequence - hr.expense.expense - - - -

-

-
+ + hr.expense.sheet.filter.sequence + hr.expense.sheet + + + + ['|', ('name', 'ilike', self), ('number', 'ilike', self)] - +
+
- - hr.expense.expense.filter.sequence - hr.expense.expense - - - - ['|', ('name', 'ilike', self), ('number', 'ilike', self)] - - - - -
-
\ No newline at end of file + From 542322dbbd1fbb6b04fd02dc4cded161c845b4fd Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 7 Jun 2017 23:37:01 +0200 Subject: [PATCH 12/44] Add _rec_name = 'number' on hr.expense.sheet --- hr_expense_sequence/i18n/cs_CZ.po | 34 +++++++++++++++++++ hr_expense_sequence/i18n/de.po | 33 ++++++++---------- hr_expense_sequence/i18n/es.po | 34 +++++++++++-------- hr_expense_sequence/i18n/fi.po | 31 ++++++++--------- hr_expense_sequence/i18n/fr.po | 31 +++++++++-------- hr_expense_sequence/i18n/hr.po | 34 +++++++++++++++++++ hr_expense_sequence/i18n/it.po | 29 ++++++++-------- hr_expense_sequence/i18n/nl_NL.po | 34 +++++++++++++++++++ hr_expense_sequence/i18n/pt_BR.po | 31 ++++++++--------- hr_expense_sequence/i18n/sl.po | 31 ++++++++--------- .../models/hr_expense_sheet.py | 1 + 11 files changed, 213 insertions(+), 110 deletions(-) create mode 100644 hr_expense_sequence/i18n/cs_CZ.po create mode 100644 hr_expense_sequence/i18n/hr.po create mode 100644 hr_expense_sequence/i18n/nl_NL.po diff --git a/hr_expense_sequence/i18n/cs_CZ.po b/hr_expense_sequence/i18n/cs_CZ.po new file mode 100644 index 000000000..5079583a7 --- /dev/null +++ b/hr_expense_sequence/i18n/cs_CZ.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +# Translators: +# Lukáš Spurný , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-02-23 03:45+0000\n" +"PO-Revision-Date: 2018-02-23 03:45+0000\n" +"Last-Translator: Lukáš Spurný , 2018\n" +"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/teams/23907/cs_CZ/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: cs_CZ\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" + +#. module: hr_expense_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet +msgid "Expense Report" +msgstr "Zpráva o výdajích" + +#. module: hr_expense_sequence +#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +msgid "Expenses Report" +msgstr "Zpráva o nákladech" + +#. module: hr_expense_sequence +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +msgid "Number" +msgstr "Číslo" diff --git a/hr_expense_sequence/i18n/de.po b/hr_expense_sequence/i18n/de.po index d5409b173..fb0804691 100644 --- a/hr_expense_sequence/i18n/de.po +++ b/hr_expense_sequence/i18n/de.po @@ -3,17 +3,15 @@ # * hr_expense_sequence # # Translators: -# Rudolf Schnapka , 2016 -# Thomas A. Jaeger, 2015 -# Thomas A. Jaeger, 2015 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-11-30 05:19+0000\n" -"PO-Revision-Date: 2016-01-26 09:44+0000\n" -"Last-Translator: Rudolf Schnapka \n" -"Language-Team: German (http://www.transifex.com/oca/OCA-hr-8-0/language/de/)\n" +"POT-Creation-Date: 2017-07-01 01:04+0000\n" +"PO-Revision-Date: 2017-07-01 01:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -21,17 +19,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence -#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense -msgid "Expense" -msgstr "Aufwand" +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet +msgid "Expense Report" +msgstr "" #. module: hr_expense_sequence -#: field:hr.expense.expense,number:0 -msgid "Number" -msgstr "Nummer" +#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +msgid "Expenses Report" +msgstr "" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence -msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" -msgstr "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +msgid "Number" +msgstr "Nummer" diff --git a/hr_expense_sequence/i18n/es.po b/hr_expense_sequence/i18n/es.po index 47ab5ed01..c276ca28f 100644 --- a/hr_expense_sequence/i18n/es.po +++ b/hr_expense_sequence/i18n/es.po @@ -1,28 +1,34 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * hr_expense_sequence -# +# * hr_expense_sequence +# +# Translators: +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-01-31 01:53+0000\n" -"PO-Revision-Date: 2015-01-31 01:53+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" +"POT-Creation-Date: 2017-07-01 01:04+0000\n" +"PO-Revision-Date: 2017-07-01 01:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence -#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense -msgid "Expense" -msgstr "Gasto" +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet +msgid "Expense Report" +msgstr "" #. module: hr_expense_sequence -#: field:hr.expense.expense,number:0 +#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +msgid "Expenses Report" +msgstr "" + +#. module: hr_expense_sequence +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number msgid "Number" msgstr "Número" - diff --git a/hr_expense_sequence/i18n/fi.po b/hr_expense_sequence/i18n/fi.po index f1173ad89..54c8bc831 100644 --- a/hr_expense_sequence/i18n/fi.po +++ b/hr_expense_sequence/i18n/fi.po @@ -3,15 +3,15 @@ # * hr_expense_sequence # # Translators: -# Jarmo Kortetjärvi , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-04-14 04:15+0000\n" -"PO-Revision-Date: 2016-04-04 11:09+0000\n" -"Last-Translator: Jarmo Kortetjärvi \n" -"Language-Team: Finnish (http://www.transifex.com/oca/OCA-hr-8-0/language/fi/)\n" +"POT-Creation-Date: 2017-07-01 01:04+0000\n" +"PO-Revision-Date: 2017-07-01 01:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,17 +19,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence -#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense -msgid "Expense" -msgstr "Kulu" +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet +msgid "Expense Report" +msgstr "" #. module: hr_expense_sequence -#: field:hr.expense.expense,number:0 -msgid "Number" -msgstr "Numero" +#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +msgid "Expenses Report" +msgstr "" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence -msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" -msgstr "" +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +msgid "Number" +msgstr "Numero" diff --git a/hr_expense_sequence/i18n/fr.po b/hr_expense_sequence/i18n/fr.po index 6739fa4f4..52eaa4f7c 100644 --- a/hr_expense_sequence/i18n/fr.po +++ b/hr_expense_sequence/i18n/fr.po @@ -3,14 +3,16 @@ # * hr_expense_sequence # # Translators: +# guillaume bauer , 2017 +# Alexandre Fayolle , 2017 msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-08-18 13:10+0000\n" -"PO-Revision-Date: 2015-07-27 23:44+0000\n" -"Last-Translator: <>\n" -"Language-Team: French (http://www.transifex.com/oca/OCA-hr-8-0/language/fr/)\n" +"POT-Creation-Date: 2018-02-23 03:45+0000\n" +"PO-Revision-Date: 2018-02-23 03:45+0000\n" +"Last-Translator: Alexandre Fayolle , 2017\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -18,17 +20,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence -#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense -msgid "Expense" -msgstr "Frais" +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet +msgid "Expense Report" +msgstr "Rapport de dépenses" #. module: hr_expense_sequence -#: field:hr.expense.expense,number:0 -msgid "Number" -msgstr "" +#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +msgid "Expenses Report" +msgstr "Rapport de dépenses" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence -msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" -msgstr "" +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +msgid "Number" +msgstr "Numéro" diff --git a/hr_expense_sequence/i18n/hr.po b/hr_expense_sequence/i18n/hr.po new file mode 100644 index 000000000..e6d16209d --- /dev/null +++ b/hr_expense_sequence/i18n/hr.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +# Translators: +# Bole , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-04 06:52+0000\n" +"PO-Revision-Date: 2017-07-04 06:52+0000\n" +"Last-Translator: Bole , 2017\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: hr_expense_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet +msgid "Expense Report" +msgstr "Izvještaj troškova" + +#. module: hr_expense_sequence +#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +msgid "Expenses Report" +msgstr "Izvještaji troškova" + +#. module: hr_expense_sequence +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +msgid "Number" +msgstr "Broj" diff --git a/hr_expense_sequence/i18n/it.po b/hr_expense_sequence/i18n/it.po index 2da87ddbe..099a9718b 100644 --- a/hr_expense_sequence/i18n/it.po +++ b/hr_expense_sequence/i18n/it.po @@ -3,15 +3,15 @@ # * hr_expense_sequence # # Translators: -# Paolo Valier, 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-12 12:02+0000\n" -"PO-Revision-Date: 2016-03-19 10:39+0000\n" -"Last-Translator: Paolo Valier\n" -"Language-Team: Italian (http://www.transifex.com/oca/OCA-hr-8-0/language/it/)\n" +"POT-Creation-Date: 2017-07-01 01:04+0000\n" +"PO-Revision-Date: 2017-07-01 01:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,17 +19,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence -#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense -msgid "Expense" +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet +msgid "Expense Report" msgstr "" #. module: hr_expense_sequence -#: field:hr.expense.expense,number:0 -msgid "Number" -msgstr "Numero" +#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +msgid "Expenses Report" +msgstr "" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence -msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" -msgstr "" +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +msgid "Number" +msgstr "Numero" diff --git a/hr_expense_sequence/i18n/nl_NL.po b/hr_expense_sequence/i18n/nl_NL.po new file mode 100644 index 000000000..5eb182a2a --- /dev/null +++ b/hr_expense_sequence/i18n/nl_NL.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +# Translators: +# Peter Hageman , 2017 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-07-01 01:04+0000\n" +"PO-Revision-Date: 2017-07-01 01:04+0000\n" +"Last-Translator: Peter Hageman , 2017\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl_NL\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: hr_expense_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet +msgid "Expense Report" +msgstr "Onkostennota" + +#. module: hr_expense_sequence +#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +msgid "Expenses Report" +msgstr "Onkostenrapport" + +#. module: hr_expense_sequence +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +msgid "Number" +msgstr "Nummer" diff --git a/hr_expense_sequence/i18n/pt_BR.po b/hr_expense_sequence/i18n/pt_BR.po index 220b8719e..339c403e4 100644 --- a/hr_expense_sequence/i18n/pt_BR.po +++ b/hr_expense_sequence/i18n/pt_BR.po @@ -3,15 +3,15 @@ # * hr_expense_sequence # # Translators: -# danimaribeiro , 2016 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2016-03-11 01:48+0000\n" -"PO-Revision-Date: 2016-03-08 03:18+0000\n" -"Last-Translator: danimaribeiro \n" -"Language-Team: Portuguese (Brazil) (http://www.transifex.com/oca/OCA-hr-8-0/language/pt_BR/)\n" +"POT-Creation-Date: 2017-07-01 01:04+0000\n" +"PO-Revision-Date: 2017-07-01 01:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,17 +19,16 @@ msgstr "" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence -#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense -msgid "Expense" -msgstr "Despesa" +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet +msgid "Expense Report" +msgstr "" #. module: hr_expense_sequence -#: field:hr.expense.expense,number:0 -msgid "Number" -msgstr "Número" +#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +msgid "Expenses Report" +msgstr "" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence -msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" -msgstr "" +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +msgid "Number" +msgstr "Número" diff --git a/hr_expense_sequence/i18n/sl.po b/hr_expense_sequence/i18n/sl.po index 7fa7c6b23..8d095bc77 100644 --- a/hr_expense_sequence/i18n/sl.po +++ b/hr_expense_sequence/i18n/sl.po @@ -3,15 +3,15 @@ # * hr_expense_sequence # # Translators: -# Matjaž Mozetič , 2015 +# OCA Transbot , 2017 msgid "" msgstr "" -"Project-Id-Version: hr (8.0)\n" +"Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-08-18 13:10+0000\n" -"PO-Revision-Date: 2015-08-01 16:13+0000\n" -"Last-Translator: Matjaž Mozetič \n" -"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-hr-8-0/language/sl/)\n" +"POT-Creation-Date: 2017-07-01 01:04+0000\n" +"PO-Revision-Date: 2017-07-01 01:04+0000\n" +"Last-Translator: OCA Transbot , 2017\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -19,17 +19,16 @@ msgstr "" "Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence -#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense -msgid "Expense" -msgstr "Izdatki" +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet +msgid "Expense Report" +msgstr "" #. module: hr_expense_sequence -#: field:hr.expense.expense,number:0 -msgid "Number" -msgstr "Številka" +#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +msgid "Expenses Report" +msgstr "" #. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_hr_expense_filter_sequence -msgid "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" -msgstr "['|', ('name', 'ilike', self), ('number', 'ilike', self)]" +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +msgid "Number" +msgstr "Številka" diff --git a/hr_expense_sequence/models/hr_expense_sheet.py b/hr_expense_sequence/models/hr_expense_sheet.py index 4e2645ff8..241150010 100644 --- a/hr_expense_sequence/models/hr_expense_sheet.py +++ b/hr_expense_sequence/models/hr_expense_sheet.py @@ -8,6 +8,7 @@ class HrExpenseSheet(models.Model): _inherit = 'hr.expense.sheet' + _rec_name = 'number' number = fields.Char(required=True, default="/", readonly=True, copy=False) From 3d19e7c1bd765c651891b62b53e9b6c10a625153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bidoul=20=28ACSONE=29?= Date: Fri, 15 Jun 2018 23:15:26 +0200 Subject: [PATCH 13/44] remove obsolete .pot files [ci skip] --- .../i18n/hr_expense_sequence.pot | 28 ------------------- 1 file changed, 28 deletions(-) delete mode 100644 hr_expense_sequence/i18n/hr_expense_sequence.pot diff --git a/hr_expense_sequence/i18n/hr_expense_sequence.pot b/hr_expense_sequence/i18n/hr_expense_sequence.pot deleted file mode 100644 index 39c92eeed..000000000 --- a/hr_expense_sequence/i18n/hr_expense_sequence.pot +++ /dev/null @@ -1,28 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * hr_expense_sequence -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-01-31 01:53+0000\n" -"PO-Revision-Date: 2015-01-31 01:53+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: hr_expense_sequence -#: view:hr.expense.expense:hr_expense_sequence.view_expenses_form_sequence -#: model:ir.model,name:hr_expense_sequence.model_hr_expense_expense -msgid "Expense" -msgstr "" - -#. module: hr_expense_sequence -#: field:hr.expense.expense,number:0 -msgid "Number" -msgstr "" - From dddd0bc59219cf905da9a0eb4c4d9e80c371a241 Mon Sep 17 00:00:00 2001 From: Andrea Date: Wed, 20 Jun 2018 08:59:34 +0200 Subject: [PATCH 14/44] Fix pylint errors + add license + fix category --- hr_expense_sequence/README.rst | 6 ++-- hr_expense_sequence/__manifest__.py | 3 +- hr_expense_sequence/data/hr_expense_data.xml | 12 ++++---- hr_expense_sequence/i18n/cs_CZ.po | 7 +++-- hr_expense_sequence/i18n/de.po | 4 +-- hr_expense_sequence/i18n/es.po | 4 +-- hr_expense_sequence/i18n/fi.po | 4 +-- hr_expense_sequence/i18n/fr.po | 4 +-- hr_expense_sequence/i18n/hr.po | 7 +++-- .../i18n/hr_expense_sequence.pot | 30 +++++++++++++++++++ hr_expense_sequence/i18n/it.po | 4 +-- hr_expense_sequence/i18n/nl_NL.po | 7 +++-- hr_expense_sequence/i18n/pt_BR.po | 7 +++-- hr_expense_sequence/i18n/sl.po | 7 +++-- 14 files changed, 71 insertions(+), 35 deletions(-) create mode 100644 hr_expense_sequence/i18n/hr_expense_sequence.pot diff --git a/hr_expense_sequence/README.rst b/hr_expense_sequence/README.rst index f90abcfeb..7d9e2fb33 100644 --- a/hr_expense_sequence/README.rst +++ b/hr_expense_sequence/README.rst @@ -13,10 +13,10 @@ Configuration You can change the default sequence (EX0001) by the one of your choice going to *Settings > Technical > Sequences & Identifiers > Sequences*, and -editing the record _Expense Report sequence_. +editing the record `Expense Report sequence`. -You will only have access to that section if your section has _Technical -features_ permission check marked. +You will only have access to that section if your section has `Technical features` +permission check marked. Usage ===== diff --git a/hr_expense_sequence/__manifest__.py b/hr_expense_sequence/__manifest__.py index a37757f8b..95b55bbbd 100644 --- a/hr_expense_sequence/__manifest__.py +++ b/hr_expense_sequence/__manifest__.py @@ -6,7 +6,8 @@ { 'name': 'HR expense sequence', 'version': '10.0.1.0.0', - 'category': 'HR', + 'license': 'AGPL-3', + 'category': 'Human Resources', 'author': "Serv. Tecnol. Avanzados - Pedro M. Baeza," "Odoo Community Association (OCA)", 'website': 'http://www.serviciosbaeza.com', diff --git a/hr_expense_sequence/data/hr_expense_data.xml b/hr_expense_sequence/data/hr_expense_data.xml index 12ec5a0b2..80a20765e 100644 --- a/hr_expense_sequence/data/hr_expense_data.xml +++ b/hr_expense_sequence/data/hr_expense_data.xml @@ -1,11 +1,11 @@ - - Expense report sequence - hr.expense.sheet - - EX - + + Expense report sequence + hr.expense.sheet + + EX + diff --git a/hr_expense_sequence/i18n/cs_CZ.po b/hr_expense_sequence/i18n/cs_CZ.po index 5079583a7..9e73e42ed 100644 --- a/hr_expense_sequence/i18n/cs_CZ.po +++ b/hr_expense_sequence/i18n/cs_CZ.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * hr_expense_sequence -# +# # Translators: # Lukáš Spurný , 2018 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2018-02-23 03:45+0000\n" "PO-Revision-Date: 2018-02-23 03:45+0000\n" "Last-Translator: Lukáš Spurný , 2018\n" -"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/teams/23907/cs_CZ/)\n" +"Language-Team: Czech (Czech Republic) (https://www.transifex.com/oca/" +"teams/23907/cs_CZ/)\n" +"Language: cs_CZ\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: cs_CZ\n" "Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" #. module: hr_expense_sequence diff --git a/hr_expense_sequence/i18n/de.po b/hr_expense_sequence/i18n/de.po index fb0804691..a45f38ea9 100644 --- a/hr_expense_sequence/i18n/de.po +++ b/hr_expense_sequence/i18n/de.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * hr_expense_sequence -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-07-01 01:04+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: de\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: hr_expense_sequence diff --git a/hr_expense_sequence/i18n/es.po b/hr_expense_sequence/i18n/es.po index c276ca28f..f3061401c 100644 --- a/hr_expense_sequence/i18n/es.po +++ b/hr_expense_sequence/i18n/es.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * hr_expense_sequence -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-07-01 01:04+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: es\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: hr_expense_sequence diff --git a/hr_expense_sequence/i18n/fi.po b/hr_expense_sequence/i18n/fi.po index 54c8bc831..06b7d01a2 100644 --- a/hr_expense_sequence/i18n/fi.po +++ b/hr_expense_sequence/i18n/fi.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * hr_expense_sequence -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-07-01 01:04+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"Language: fi\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fi\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: hr_expense_sequence diff --git a/hr_expense_sequence/i18n/fr.po b/hr_expense_sequence/i18n/fr.po index 52eaa4f7c..ec7af0450 100644 --- a/hr_expense_sequence/i18n/fr.po +++ b/hr_expense_sequence/i18n/fr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * hr_expense_sequence -# +# # Translators: # guillaume bauer , 2017 # Alexandre Fayolle , 2017 @@ -13,10 +13,10 @@ msgstr "" "PO-Revision-Date: 2018-02-23 03:45+0000\n" "Last-Translator: Alexandre Fayolle , 2017\n" "Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: fr\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: hr_expense_sequence diff --git a/hr_expense_sequence/i18n/hr.po b/hr_expense_sequence/i18n/hr.po index e6d16209d..2ba24b3b3 100644 --- a/hr_expense_sequence/i18n/hr.po +++ b/hr_expense_sequence/i18n/hr.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * hr_expense_sequence -# +# # Translators: # Bole , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-07-04 06:52+0000\n" "Last-Translator: Bole , 2017\n" "Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"Language: hr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: hr\n" -"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" #. module: hr_expense_sequence #: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet diff --git a/hr_expense_sequence/i18n/hr_expense_sequence.pot b/hr_expense_sequence/i18n/hr_expense_sequence.pot new file mode 100644 index 000000000..131d9c52b --- /dev/null +++ b/hr_expense_sequence/i18n/hr_expense_sequence.pot @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * hr_expense_sequence +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: hr_expense_sequence +#: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet +msgid "Expense Report" +msgstr "" + +#. module: hr_expense_sequence +#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +msgid "Expenses Report" +msgstr "" + +#. module: hr_expense_sequence +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +msgid "Number" +msgstr "" + diff --git a/hr_expense_sequence/i18n/it.po b/hr_expense_sequence/i18n/it.po index 099a9718b..441496433 100644 --- a/hr_expense_sequence/i18n/it.po +++ b/hr_expense_sequence/i18n/it.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * hr_expense_sequence -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,10 +12,10 @@ msgstr "" "PO-Revision-Date: 2017-07-01 01:04+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"Language: it\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: it\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: hr_expense_sequence diff --git a/hr_expense_sequence/i18n/nl_NL.po b/hr_expense_sequence/i18n/nl_NL.po index 5eb182a2a..b6fb14b26 100644 --- a/hr_expense_sequence/i18n/nl_NL.po +++ b/hr_expense_sequence/i18n/nl_NL.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * hr_expense_sequence -# +# # Translators: # Peter Hageman , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-07-01 01:04+0000\n" "PO-Revision-Date: 2017-07-01 01:04+0000\n" "Last-Translator: Peter Hageman , 2017\n" -"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/teams/23907/nl_NL/)\n" +"Language-Team: Dutch (Netherlands) (https://www.transifex.com/oca/" +"teams/23907/nl_NL/)\n" +"Language: nl_NL\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: nl_NL\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #. module: hr_expense_sequence diff --git a/hr_expense_sequence/i18n/pt_BR.po b/hr_expense_sequence/i18n/pt_BR.po index 339c403e4..9a08f55bc 100644 --- a/hr_expense_sequence/i18n/pt_BR.po +++ b/hr_expense_sequence/i18n/pt_BR.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * hr_expense_sequence -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -11,11 +11,12 @@ msgstr "" "POT-Creation-Date: 2017-07-01 01:04+0000\n" "PO-Revision-Date: 2017-07-01 01:04+0000\n" "Last-Translator: OCA Transbot , 2017\n" -"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/" +"teams/23907/pt_BR/)\n" +"Language: pt_BR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: pt_BR\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: hr_expense_sequence diff --git a/hr_expense_sequence/i18n/sl.po b/hr_expense_sequence/i18n/sl.po index 8d095bc77..ec313a804 100644 --- a/hr_expense_sequence/i18n/sl.po +++ b/hr_expense_sequence/i18n/sl.po @@ -1,7 +1,7 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: # * hr_expense_sequence -# +# # Translators: # OCA Transbot , 2017 msgid "" @@ -12,11 +12,12 @@ msgstr "" "PO-Revision-Date: 2017-07-01 01:04+0000\n" "Last-Translator: OCA Transbot , 2017\n" "Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Language: sl\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" #. module: hr_expense_sequence #: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet From b17c075c270a93114270aac072a4cfbc9dcb5b82 Mon Sep 17 00:00:00 2001 From: Maria Sparenberg Date: Tue, 18 Dec 2018 11:44:06 +0000 Subject: [PATCH 15/44] Translated using Weblate (German) Currently translated at 100.0% (3 of 3 strings) Translation: hr-10.0/hr-10.0-hr_expense_sequence Translate-URL: https://translation.odoo-community.org/projects/hr-10-0/hr-10-0-hr_expense_sequence/de/ --- hr_expense_sequence/i18n/de.po | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hr_expense_sequence/i18n/de.po b/hr_expense_sequence/i18n/de.po index a45f38ea9..87db973d9 100644 --- a/hr_expense_sequence/i18n/de.po +++ b/hr_expense_sequence/i18n/de.po @@ -9,24 +9,25 @@ msgstr "" "Project-Id-Version: Odoo Server 10.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-07-01 01:04+0000\n" -"PO-Revision-Date: 2017-07-01 01:04+0000\n" -"Last-Translator: OCA Transbot , 2017\n" +"PO-Revision-Date: 2018-12-18 15:58+0000\n" +"Last-Translator: Maria Sparenberg \n" "Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" "Language: de\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.3\n" #. module: hr_expense_sequence #: model:ir.model,name:hr_expense_sequence.model_hr_expense_sheet msgid "Expense Report" -msgstr "" +msgstr "Spesen-Bericht" #. module: hr_expense_sequence #: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" -msgstr "" +msgstr "Spesen-Bericht" #. module: hr_expense_sequence #: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number From e3f7ba747b35f9847af06a55a562a6e7215a60d0 Mon Sep 17 00:00:00 2001 From: ps-tubtim Date: Wed, 12 Jun 2019 16:05:48 +0700 Subject: [PATCH 16/44] [MIG] hr_expense_sequence: Migration to 12.0 --- hr_expense_sequence/README.rst | 80 ++-- hr_expense_sequence/__init__.py | 2 +- hr_expense_sequence/__manifest__.py | 13 +- hr_expense_sequence/data/hr_expense_data.xml | 2 +- hr_expense_sequence/i18n/cs_CZ.po | 4 +- hr_expense_sequence/i18n/de.po | 4 +- hr_expense_sequence/i18n/es.po | 4 +- hr_expense_sequence/i18n/fi.po | 4 +- hr_expense_sequence/i18n/fr.po | 4 +- hr_expense_sequence/i18n/hr.po | 4 +- .../i18n/hr_expense_sequence.pot | 6 +- hr_expense_sequence/i18n/it.po | 4 +- hr_expense_sequence/i18n/nl_NL.po | 4 +- hr_expense_sequence/i18n/pt_BR.po | 4 +- hr_expense_sequence/i18n/sl.po | 4 +- hr_expense_sequence/models/__init__.py | 2 +- .../models/hr_expense_sheet.py | 5 +- hr_expense_sequence/readme/CONFIGURE.rst | 6 + hr_expense_sequence/readme/CONTRIBUTORS.rst | 2 + hr_expense_sequence/readme/DESCRIPTION.rst | 2 + .../report/report_expense_sheet.xml | 11 +- .../static/description/index.html | 430 ++++++++++++++++++ hr_expense_sequence/tests/__init__.py | 3 + .../tests/test_hr_expense_sequence.py | 53 +++ 24 files changed, 590 insertions(+), 67 deletions(-) create mode 100644 hr_expense_sequence/readme/CONFIGURE.rst create mode 100644 hr_expense_sequence/readme/CONTRIBUTORS.rst create mode 100644 hr_expense_sequence/readme/DESCRIPTION.rst create mode 100644 hr_expense_sequence/static/description/index.html create mode 100644 hr_expense_sequence/tests/__init__.py create mode 100644 hr_expense_sequence/tests/test_hr_expense_sequence.py diff --git a/hr_expense_sequence/README.rst b/hr_expense_sequence/README.rst index 7d9e2fb33..5e0b35a1b 100644 --- a/hr_expense_sequence/README.rst +++ b/hr_expense_sequence/README.rst @@ -1,12 +1,37 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 - -============================ -Sequence for Expense Reports -============================ - -This module gives a unique number for each *Expense Report* (object *hr.expense.sheet*). +=================== +HR expense sequence +=================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github + :target: https://github.com/OCA/hr/tree/12.0/hr_expense_sequence + :alt: OCA/hr +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_expense_sequence + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/116/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds the possibility to define a sequence for the expense report's reference. +This reference is then set as default when you create a new expense report, using the defined sequence. + +**Table of contents** + +.. contents:: + :local: Configuration ============= @@ -18,40 +43,43 @@ editing the record `Expense Report sequence`. You will only have access to that section if your section has `Technical features` permission check marked. -Usage -===== - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/116/10.0 - Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* Serv. Tecnol. Avanzados - Pedro M. Baeza + Contributors ------------- +~~~~~~~~~~~~ * Pedro M. Baeza +* Pimolnat Suntian + +Maintainers +~~~~~~~~~~~ -Maintainer ----------- +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/hr `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_expense_sequence/__init__.py b/hr_expense_sequence/__init__.py index 306e39eea..3e1bc0c82 100644 --- a/hr_expense_sequence/__init__.py +++ b/hr_expense_sequence/__init__.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models from odoo import api, SUPERUSER_ID diff --git a/hr_expense_sequence/__manifest__.py b/hr_expense_sequence/__manifest__.py index 95b55bbbd..a7df9c0df 100644 --- a/hr_expense_sequence/__manifest__.py +++ b/hr_expense_sequence/__manifest__.py @@ -1,16 +1,15 @@ -# -*- coding: utf-8 -*- -# © 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Copyright 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'HR expense sequence', - 'version': '10.0.1.0.0', + 'version': '12.0.1.0.0', 'license': 'AGPL-3', 'category': 'Human Resources', - 'author': "Serv. Tecnol. Avanzados - Pedro M. Baeza," - "Odoo Community Association (OCA)", - 'website': 'http://www.serviciosbaeza.com', + 'author': 'Serv. Tecnol. Avanzados - Pedro M. Baeza,' + 'Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/hr', 'depends': [ 'hr_expense', ], @@ -20,5 +19,5 @@ 'report/report_expense_sheet.xml', ], 'installable': True, - "post_init_hook": "assign_old_sequences", + 'post_init_hook': 'assign_old_sequences', } diff --git a/hr_expense_sequence/data/hr_expense_data.xml b/hr_expense_sequence/data/hr_expense_data.xml index 80a20765e..47f09d08c 100644 --- a/hr_expense_sequence/data/hr_expense_data.xml +++ b/hr_expense_sequence/data/hr_expense_data.xml @@ -1,4 +1,4 @@ - + diff --git a/hr_expense_sequence/i18n/cs_CZ.po b/hr_expense_sequence/i18n/cs_CZ.po index 9e73e42ed..2c5025186 100644 --- a/hr_expense_sequence/i18n/cs_CZ.po +++ b/hr_expense_sequence/i18n/cs_CZ.po @@ -25,11 +25,11 @@ msgid "Expense Report" msgstr "Zpráva o výdajích" #. module: hr_expense_sequence -#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +#: model_terms:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" msgstr "Zpráva o nákladech" #. module: hr_expense_sequence -#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "Číslo" diff --git a/hr_expense_sequence/i18n/de.po b/hr_expense_sequence/i18n/de.po index 87db973d9..315867f9b 100644 --- a/hr_expense_sequence/i18n/de.po +++ b/hr_expense_sequence/i18n/de.po @@ -25,11 +25,11 @@ msgid "Expense Report" msgstr "Spesen-Bericht" #. module: hr_expense_sequence -#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +#: model_terms:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" msgstr "Spesen-Bericht" #. module: hr_expense_sequence -#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "Nummer" diff --git a/hr_expense_sequence/i18n/es.po b/hr_expense_sequence/i18n/es.po index f3061401c..61529afa0 100644 --- a/hr_expense_sequence/i18n/es.po +++ b/hr_expense_sequence/i18n/es.po @@ -24,11 +24,11 @@ msgid "Expense Report" msgstr "" #. module: hr_expense_sequence -#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +#: model_terms:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" msgstr "" #. module: hr_expense_sequence -#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "Número" diff --git a/hr_expense_sequence/i18n/fi.po b/hr_expense_sequence/i18n/fi.po index 06b7d01a2..0ac819b73 100644 --- a/hr_expense_sequence/i18n/fi.po +++ b/hr_expense_sequence/i18n/fi.po @@ -24,11 +24,11 @@ msgid "Expense Report" msgstr "" #. module: hr_expense_sequence -#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +#: model_terms:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" msgstr "" #. module: hr_expense_sequence -#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "Numero" diff --git a/hr_expense_sequence/i18n/fr.po b/hr_expense_sequence/i18n/fr.po index ec7af0450..6eabc5304 100644 --- a/hr_expense_sequence/i18n/fr.po +++ b/hr_expense_sequence/i18n/fr.po @@ -25,11 +25,11 @@ msgid "Expense Report" msgstr "Rapport de dépenses" #. module: hr_expense_sequence -#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +#: model_terms:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" msgstr "Rapport de dépenses" #. module: hr_expense_sequence -#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "Numéro" diff --git a/hr_expense_sequence/i18n/hr.po b/hr_expense_sequence/i18n/hr.po index 2ba24b3b3..84a2dc06d 100644 --- a/hr_expense_sequence/i18n/hr.po +++ b/hr_expense_sequence/i18n/hr.po @@ -25,11 +25,11 @@ msgid "Expense Report" msgstr "Izvještaj troškova" #. module: hr_expense_sequence -#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +#: model_terms:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" msgstr "Izvještaji troškova" #. module: hr_expense_sequence -#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "Broj" diff --git a/hr_expense_sequence/i18n/hr_expense_sequence.pot b/hr_expense_sequence/i18n/hr_expense_sequence.pot index 131d9c52b..7aa688afb 100644 --- a/hr_expense_sequence/i18n/hr_expense_sequence.pot +++ b/hr_expense_sequence/i18n/hr_expense_sequence.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 10.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -19,12 +19,12 @@ msgid "Expense Report" msgstr "" #. module: hr_expense_sequence -#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +#: model_terms:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" msgstr "" #. module: hr_expense_sequence -#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "" diff --git a/hr_expense_sequence/i18n/it.po b/hr_expense_sequence/i18n/it.po index 441496433..537c338e6 100644 --- a/hr_expense_sequence/i18n/it.po +++ b/hr_expense_sequence/i18n/it.po @@ -24,11 +24,11 @@ msgid "Expense Report" msgstr "" #. module: hr_expense_sequence -#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +#: model_terms:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" msgstr "" #. module: hr_expense_sequence -#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "Numero" diff --git a/hr_expense_sequence/i18n/nl_NL.po b/hr_expense_sequence/i18n/nl_NL.po index b6fb14b26..a567a8a82 100644 --- a/hr_expense_sequence/i18n/nl_NL.po +++ b/hr_expense_sequence/i18n/nl_NL.po @@ -25,11 +25,11 @@ msgid "Expense Report" msgstr "Onkostennota" #. module: hr_expense_sequence -#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +#: model_terms:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" msgstr "Onkostenrapport" #. module: hr_expense_sequence -#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "Nummer" diff --git a/hr_expense_sequence/i18n/pt_BR.po b/hr_expense_sequence/i18n/pt_BR.po index 9a08f55bc..298c80a87 100644 --- a/hr_expense_sequence/i18n/pt_BR.po +++ b/hr_expense_sequence/i18n/pt_BR.po @@ -25,11 +25,11 @@ msgid "Expense Report" msgstr "" #. module: hr_expense_sequence -#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +#: model_terms:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" msgstr "" #. module: hr_expense_sequence -#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "Número" diff --git a/hr_expense_sequence/i18n/sl.po b/hr_expense_sequence/i18n/sl.po index ec313a804..14b3be904 100644 --- a/hr_expense_sequence/i18n/sl.po +++ b/hr_expense_sequence/i18n/sl.po @@ -25,11 +25,11 @@ msgid "Expense Report" msgstr "" #. module: hr_expense_sequence -#: model:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet +#: model_terms:ir.ui.view,arch_db:hr_expense_sequence.report_expense_sheet msgid "Expenses Report" msgstr "" #. module: hr_expense_sequence -#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet_number +#: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "Številka" diff --git a/hr_expense_sequence/models/__init__.py b/hr_expense_sequence/models/__init__.py index 60078d06c..8855b0755 100644 --- a/hr_expense_sequence/models/__init__.py +++ b/hr_expense_sequence/models/__init__.py @@ -1,3 +1,3 @@ -# -*- coding: utf-8 -*- +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import hr_expense_sheet diff --git a/hr_expense_sequence/models/hr_expense_sheet.py b/hr_expense_sequence/models/hr_expense_sheet.py index 241150010..6530cd33d 100644 --- a/hr_expense_sequence/models/hr_expense_sheet.py +++ b/hr_expense_sequence/models/hr_expense_sheet.py @@ -1,5 +1,4 @@ -# -*- coding: utf-8 -*- -# © 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Copyright 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -10,7 +9,7 @@ class HrExpenseSheet(models.Model): _inherit = 'hr.expense.sheet' _rec_name = 'number' - number = fields.Char(required=True, default="/", readonly=True, copy=False) + number = fields.Char(required=True, default='/', readonly=True, copy=False) @api.model def create(self, vals): diff --git a/hr_expense_sequence/readme/CONFIGURE.rst b/hr_expense_sequence/readme/CONFIGURE.rst new file mode 100644 index 000000000..2486a712f --- /dev/null +++ b/hr_expense_sequence/readme/CONFIGURE.rst @@ -0,0 +1,6 @@ +You can change the default sequence (EX0001) by the one of your choice +going to *Settings > Technical > Sequences & Identifiers > Sequences*, and +editing the record `Expense Report sequence`. + +You will only have access to that section if your section has `Technical features` +permission check marked. diff --git a/hr_expense_sequence/readme/CONTRIBUTORS.rst b/hr_expense_sequence/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000..48c49d186 --- /dev/null +++ b/hr_expense_sequence/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Pedro M. Baeza +* Pimolnat Suntian diff --git a/hr_expense_sequence/readme/DESCRIPTION.rst b/hr_expense_sequence/readme/DESCRIPTION.rst new file mode 100644 index 000000000..a26f99d2c --- /dev/null +++ b/hr_expense_sequence/readme/DESCRIPTION.rst @@ -0,0 +1,2 @@ +This module adds the possibility to define a sequence for the expense report's reference. +This reference is then set as default when you create a new expense report, using the defined sequence. diff --git a/hr_expense_sequence/report/report_expense_sheet.xml b/hr_expense_sequence/report/report_expense_sheet.xml index 39cba7100..b2730c794 100644 --- a/hr_expense_sequence/report/report_expense_sheet.xml +++ b/hr_expense_sequence/report/report_expense_sheet.xml @@ -1,10 +1,11 @@ - + diff --git a/hr_expense_sequence/static/description/index.html b/hr_expense_sequence/static/description/index.html new file mode 100644 index 000000000..7e53f7a5b --- /dev/null +++ b/hr_expense_sequence/static/description/index.html @@ -0,0 +1,430 @@ + + + + + + +HR expense sequence + + + +
+

HR expense sequence

+ + +

Beta License: AGPL-3 OCA/hr Translate me on Weblate Try me on Runbot

+

This module adds the possibility to define a sequence for the expense report’s reference. +This reference is then set as default when you create a new expense report, using the defined sequence.

+

Table of contents

+ +
+

Configuration

+

You can change the default sequence (EX0001) by the one of your choice +going to Settings > Technical > Sequences & Identifiers > Sequences, and +editing the record Expense Report sequence.

+

You will only have access to that section if your section has Technical features +permission check marked.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Serv. Tecnol. Avanzados - Pedro M. Baeza
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/hr project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/hr_expense_sequence/tests/__init__.py b/hr_expense_sequence/tests/__init__.py new file mode 100644 index 000000000..68ada0e47 --- /dev/null +++ b/hr_expense_sequence/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_hr_expense_sequence diff --git a/hr_expense_sequence/tests/test_hr_expense_sequence.py b/hr_expense_sequence/tests/test_hr_expense_sequence.py new file mode 100644 index 000000000..0b1e9cb3c --- /dev/null +++ b/hr_expense_sequence/tests/test_hr_expense_sequence.py @@ -0,0 +1,53 @@ +# Copyright 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import SavepointCase + + +class TestHrExpenseSequence(SavepointCase): + + @classmethod + def setUpClass(self): + super().setUpClass() + self.expense_model = self.env['hr.expense'] + self.expense_sheet_model = self.env['hr.expense.sheet'] + self.product = self.env.ref('product.product_product_4') + + employee_home = self.env['res.partner'].create({ + 'name': 'Employee Home Address', + }) + self.employee = self.env['hr.employee'].create({ + 'name': 'Employee', + 'address_home_id': employee_home.id, + }) + self.expense = self.create_expense(self, 'Expense') + + def create_expense(self, name): + """ Returns an open expense """ + expense = self.expense_model.create({ + 'name': name, + 'employee_id': self.employee.id, + 'product_id': self.product.id, + 'unit_amount': self.product.standard_price, + 'quantity': 1, + }) + expense.action_submit_expenses() + return expense + + def test_create_sequence(self): + # Test number != '/' + self.sheet = self.expense_sheet_model.create({ + 'name': 'Expense Report', + 'employee_id': self.employee.id, + }) + self.assertNotEqual(self.sheet.number, '/', 'Number create') + # Test number 1 != number 2 + expense_number_1 = self.sheet.number + expense2 = self.sheet.copy() + expense_number_2 = expense2.number + self.assertNotEqual( + expense_number_1, + expense_number_2, + 'Numbers are different' + ) From 820d9248725b9e2495a72ef77455c3fc9d5ca152 Mon Sep 17 00:00:00 2001 From: ps-tubtim Date: Mon, 9 Dec 2019 11:12:33 +0700 Subject: [PATCH 17/44] [IMP] hr_expense_sequence: black, isort --- hr_expense_sequence/__init__.py | 12 +--- hr_expense_sequence/__manifest__.py | 30 +++++----- .../models/hr_expense_sheet.py | 14 ++--- .../tests/test_hr_expense_sequence.py | 55 ++++++++----------- 4 files changed, 46 insertions(+), 65 deletions(-) diff --git a/hr_expense_sequence/__init__.py b/hr_expense_sequence/__init__.py index 3e1bc0c82..e309f3899 100644 --- a/hr_expense_sequence/__init__.py +++ b/hr_expense_sequence/__init__.py @@ -1,14 +1,4 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models -from odoo import api, SUPERUSER_ID - - -def assign_old_sequences(cr, registry): - with api.Environment.manage(): - env = api.Environment(cr, SUPERUSER_ID, {}) - expense_obj = env['hr.expense.sheet'] - sequence_obj = env['ir.sequence'] - for expense in expense_obj.search([], order='id'): - expense.write({ - 'number': sequence_obj.next_by_code('hr.expense.sheet')}) +from .hooks import post_init_hook diff --git a/hr_expense_sequence/__manifest__.py b/hr_expense_sequence/__manifest__.py index a7df9c0df..a3a4b19b1 100644 --- a/hr_expense_sequence/__manifest__.py +++ b/hr_expense_sequence/__manifest__.py @@ -3,21 +3,19 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - 'name': 'HR expense sequence', - 'version': '12.0.1.0.0', - 'license': 'AGPL-3', - 'category': 'Human Resources', - 'author': 'Serv. Tecnol. Avanzados - Pedro M. Baeza,' - 'Odoo Community Association (OCA)', - 'website': 'https://github.com/OCA/hr', - 'depends': [ - 'hr_expense', + "name": "HR expense sequence", + "version": "13.0.1.0.0", + "license": "AGPL-3", + "category": "Human Resources", + "author": "Serv. Tecnol. Avanzados - Pedro M. Baeza," + "Odoo Community Association (OCA)", + "website": "https://github.com/OCA/hr", + "depends": ["hr_expense"], + "data": [ + "data/hr_expense_data.xml", + "views/hr_expense_expense_view.xml", + "report/report_expense_sheet.xml", ], - 'data': [ - 'data/hr_expense_data.xml', - 'views/hr_expense_expense_view.xml', - 'report/report_expense_sheet.xml', - ], - 'installable': True, - 'post_init_hook': 'assign_old_sequences', + "installable": True, + "post_init_hook": "assign_old_sequences", } diff --git a/hr_expense_sequence/models/hr_expense_sheet.py b/hr_expense_sequence/models/hr_expense_sheet.py index 6530cd33d..de487f5e4 100644 --- a/hr_expense_sequence/models/hr_expense_sheet.py +++ b/hr_expense_sequence/models/hr_expense_sheet.py @@ -2,18 +2,18 @@ # Pedro M. Baeza # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api +from odoo import api, fields, models class HrExpenseSheet(models.Model): - _inherit = 'hr.expense.sheet' - _rec_name = 'number' + _inherit = "hr.expense.sheet" + _rec_name = "number" - number = fields.Char(required=True, default='/', readonly=True, copy=False) + number = fields.Char(required=True, default="/", readonly=True, copy=False) @api.model def create(self, vals): - if vals.get('number', '/') == '/': - number = self.env['ir.sequence'].next_by_code('hr.expense.sheet') - vals['number'] = number + if vals.get("number", "/") == "/": + number = self.env["ir.sequence"].next_by_code("hr.expense.sheet") + vals["number"] = number return super(HrExpenseSheet, self).create(vals) diff --git a/hr_expense_sequence/tests/test_hr_expense_sequence.py b/hr_expense_sequence/tests/test_hr_expense_sequence.py index 0b1e9cb3c..e1d0decee 100644 --- a/hr_expense_sequence/tests/test_hr_expense_sequence.py +++ b/hr_expense_sequence/tests/test_hr_expense_sequence.py @@ -6,48 +6,41 @@ class TestHrExpenseSequence(SavepointCase): - @classmethod - def setUpClass(self): - super().setUpClass() - self.expense_model = self.env['hr.expense'] - self.expense_sheet_model = self.env['hr.expense.sheet'] - self.product = self.env.ref('product.product_product_4') + def setUpClass(cls): + super(TestHrExpenseSequence, cls).setUpClass() + cls.expense_model = cls.env["hr.expense"] + cls.expense_sheet_model = cls.env["hr.expense.sheet"] + cls.product = cls.env.ref("product.product_product_4") - employee_home = self.env['res.partner'].create({ - 'name': 'Employee Home Address', - }) - self.employee = self.env['hr.employee'].create({ - 'name': 'Employee', - 'address_home_id': employee_home.id, - }) - self.expense = self.create_expense(self, 'Expense') + employee_home = cls.env["res.partner"].create({"name": "Employee Home Address"}) + cls.employee = cls.env["hr.employee"].create( + {"name": "Employee", "address_home_id": employee_home.id} + ) + cls.expense = cls.create_expense(cls, "Expense") def create_expense(self, name): """ Returns an open expense """ - expense = self.expense_model.create({ - 'name': name, - 'employee_id': self.employee.id, - 'product_id': self.product.id, - 'unit_amount': self.product.standard_price, - 'quantity': 1, - }) + expense = self.expense_model.create( + { + "name": name, + "employee_id": self.employee.id, + "product_id": self.product.id, + "unit_amount": self.product.standard_price, + "quantity": 1, + } + ) expense.action_submit_expenses() return expense def test_create_sequence(self): # Test number != '/' - self.sheet = self.expense_sheet_model.create({ - 'name': 'Expense Report', - 'employee_id': self.employee.id, - }) - self.assertNotEqual(self.sheet.number, '/', 'Number create') + self.sheet = self.expense_sheet_model.create( + {"name": "Expense Report", "employee_id": self.employee.id} + ) + self.assertNotEqual(self.sheet.number, "/", "Number create") # Test number 1 != number 2 expense_number_1 = self.sheet.number expense2 = self.sheet.copy() expense_number_2 = expense2.number - self.assertNotEqual( - expense_number_1, - expense_number_2, - 'Numbers are different' - ) + self.assertNotEqual(expense_number_1, expense_number_2, "Numbers are different") From 5f2da816b1e32f3530367774f8b6e6cfb5259d04 Mon Sep 17 00:00:00 2001 From: ps-tubtim Date: Mon, 17 Aug 2020 16:45:21 +0700 Subject: [PATCH 18/44] [MIG] hr_expense_sequence: Migration to 13.0 --- hr_expense_sequence/README.rst | 16 ++++++------- hr_expense_sequence/__init__.py | 2 +- hr_expense_sequence/__manifest__.py | 2 +- hr_expense_sequence/data/hr_expense_data.xml | 8 +++---- hr_expense_sequence/hooks.py | 14 +++++++++++ .../i18n/hr_expense_sequence.pot | 7 +++--- .../report/report_expense_sheet.xml | 9 +++---- .../static/description/index.html | 8 +++---- .../views/hr_expense_expense_view.xml | 24 +++++++++---------- 9 files changed, 48 insertions(+), 42 deletions(-) create mode 100644 hr_expense_sequence/hooks.py diff --git a/hr_expense_sequence/README.rst b/hr_expense_sequence/README.rst index 5e0b35a1b..7d25a5eb2 100644 --- a/hr_expense_sequence/README.rst +++ b/hr_expense_sequence/README.rst @@ -13,14 +13,14 @@ HR expense sequence .. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 -.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr-lightgray.png?logo=github - :target: https://github.com/OCA/hr/tree/12.0/hr_expense_sequence - :alt: OCA/hr +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fhr--expense-lightgray.png?logo=github + :target: https://github.com/OCA/hr-expense/tree/13.0/hr_expense_sequence + :alt: OCA/hr-expense .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/hr-12-0/hr-12-0-hr_expense_sequence + :target: https://translation.odoo-community.org/projects/hr-expense-13-0/hr-expense-13-0-hr_expense_sequence :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/116/12.0 + :target: https://runbot.odoo-community.org/runbot/289/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -46,10 +46,10 @@ permission check marked. Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. +Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -80,6 +80,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/hr `_ project on GitHub. +This module is part of the `OCA/hr-expense `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/hr_expense_sequence/__init__.py b/hr_expense_sequence/__init__.py index e309f3899..dc8f4578f 100644 --- a/hr_expense_sequence/__init__.py +++ b/hr_expense_sequence/__init__.py @@ -1,4 +1,4 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from . import models -from .hooks import post_init_hook +from .hooks import assign_old_sequences diff --git a/hr_expense_sequence/__manifest__.py b/hr_expense_sequence/__manifest__.py index a3a4b19b1..4a1952162 100644 --- a/hr_expense_sequence/__manifest__.py +++ b/hr_expense_sequence/__manifest__.py @@ -9,7 +9,7 @@ "category": "Human Resources", "author": "Serv. Tecnol. Avanzados - Pedro M. Baeza," "Odoo Community Association (OCA)", - "website": "https://github.com/OCA/hr", + "website": "https://github.com/OCA/hr-expense", "depends": ["hr_expense"], "data": [ "data/hr_expense_data.xml", diff --git a/hr_expense_sequence/data/hr_expense_data.xml b/hr_expense_sequence/data/hr_expense_data.xml index 47f09d08c..8d12f4d48 100644 --- a/hr_expense_sequence/data/hr_expense_data.xml +++ b/hr_expense_sequence/data/hr_expense_data.xml @@ -1,11 +1,9 @@ - + - - + Expense report sequence hr.expense.sheet - + EX - diff --git a/hr_expense_sequence/hooks.py b/hr_expense_sequence/hooks.py new file mode 100644 index 000000000..b020cd1d0 --- /dev/null +++ b/hr_expense_sequence/hooks.py @@ -0,0 +1,14 @@ +# Copyright 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) +# Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import SUPERUSER_ID, api + + +def assign_old_sequences(cr, registry): + with api.Environment.manage(): + env = api.Environment(cr, SUPERUSER_ID, {}) + expense_obj = env["hr.expense.sheet"] + sequence_obj = env["ir.sequence"] + for expense in expense_obj.search([], order="id"): + expense.write({"number": sequence_obj.next_by_code("hr.expense.sheet")}) diff --git a/hr_expense_sequence/i18n/hr_expense_sequence.pot b/hr_expense_sequence/i18n/hr_expense_sequence.pot index 7aa688afb..5bdb19329 100644 --- a/hr_expense_sequence/i18n/hr_expense_sequence.pot +++ b/hr_expense_sequence/i18n/hr_expense_sequence.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * hr_expense_sequence +# * hr_expense_sequence # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -27,4 +27,3 @@ msgstr "" #: model:ir.model.fields,field_description:hr_expense_sequence.field_hr_expense_sheet__number msgid "Number" msgstr "" - diff --git a/hr_expense_sequence/report/report_expense_sheet.xml b/hr_expense_sequence/report/report_expense_sheet.xml index b2730c794..7d591adef 100644 --- a/hr_expense_sequence/report/report_expense_sheet.xml +++ b/hr_expense_sequence/report/report_expense_sheet.xml @@ -1,11 +1,8 @@ - + - -