Merge lp:~inddiana/sisb/yenni_sisb_nomina_secuencia_cod_trabajador into lp:sisb

Proposed by [SISB] Yennifer Santiago Z
Status: Needs review
Proposed branch: lp:~inddiana/sisb/yenni_sisb_nomina_secuencia_cod_trabajador
Merge into: lp:sisb
Diff against target: 199 lines (+154/-1)
5 files modified
sisb_codigo_trabajador/__init__.py (+24/-0)
sisb_codigo_trabajador/__openerp__.py (+45/-0)
sisb_codigo_trabajador/codigo_trabajador.py (+53/-0)
sisb_codigo_trabajador/view/codigo_trabajador_view.xml (+31/-0)
sisb_nomina/hr_shift_rotation.py (+1/-1)
To merge this branch: bzr merge lp:~inddiana/sisb/yenni_sisb_nomina_secuencia_cod_trabajador
Reviewer Review Type Date Requested Status
Industrias Diana Pending
Review via email: mp+181155@code.launchpad.net

Description of the change

[ADD] Modulo para generacion por medio de una
secuencia de los codigos de los trabajdores segun
la sede a la que pertenezcan.

To post a comment you must log in.

Unmerged revisions

555. By [SISB] Yennifer Santiago Z

[ADD] Modulo para generacion por medio de una
secuencia de los codigos de los trabajdores segun
la sede a la que pertenezcan.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added directory 'sisb_codigo_trabajador'
2=== added file 'sisb_codigo_trabajador/__init__.py'
3--- sisb_codigo_trabajador/__init__.py 1970-01-01 00:00:00 +0000
4+++ sisb_codigo_trabajador/__init__.py 2013-08-20 21:03:31 +0000
5@@ -0,0 +1,24 @@
6+#-*- coding:utf-8 -*-
7+##############################################################################
8+#
9+# SISB, Sistema Integral Simón Bolivar
10+# Copyright (C) 2012-2013 Industrias Diana, C.A. All Rights Reserved
11+#
12+# This program is free software: you can redistribute it and/or modify
13+# it under the terms of the GNU Affero General Public License as published by
14+# the Free Software Foundation, either version 3 of the License, or
15+# (at your option) any later version.
16+#
17+# This program is distributed in the hope that it will be useful,
18+# but WITHOUT ANY WARRANTY; without even the implied warranty of
19+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20+# GNU Affero General Public License for more details.
21+#
22+# You should have received a copy of the GNU Affero General Public License
23+# along with this program. If not, see <http://www.gnu.org/licenses/>.
24+#
25+##############################################################################
26+
27+import codigo_trabajador
28+
29+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
30
31=== added file 'sisb_codigo_trabajador/__openerp__.py'
32--- sisb_codigo_trabajador/__openerp__.py 1970-01-01 00:00:00 +0000
33+++ sisb_codigo_trabajador/__openerp__.py 2013-08-20 21:03:31 +0000
34@@ -0,0 +1,45 @@
35+#-*- coding:utf-8 -*-
36+##############################################################################
37+#
38+# SISB, Sistema Integral Simón Bolivar
39+# Copyright (C) 2012-2013 Industrias Diana, C.A. All Rights Reserved
40+#
41+# This program is free software: you can redistribute it and/or modify
42+# it under the terms of the GNU Affero General Public License as published by
43+# the Free Software Foundation, either version 3 of the License, or
44+# (at your option) any later version.
45+#
46+# This program is distributed in the hope that it will be useful,
47+# but WITHOUT ANY WARRANTY; without even the implied warranty of
48+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
49+# GNU Affero General Public License for more details.
50+#
51+# You should have received a copy of the GNU Affero General Public License
52+# along with this program. If not, see <http://www.gnu.org/licenses/>.
53+#
54+##############################################################################
55+{
56+ 'name': 'Codigo Trabajador',
57+ 'version': '1.0',
58+ 'category': 'Talento Humano',
59+ "sequence": 38,
60+ 'complexity': "normal",
61+ 'description': """ """,
62+ 'author':'Industrias Diana C.A.',
63+ 'website':'http://www.industriasdiana.gob.ve',
64+ 'depends': [
65+ 'sisb_nomina',
66+ ],
67+ 'init_xml': [
68+ ],
69+ 'update_xml': [
70+ 'view/codigo_trabajador_view.xml',
71+ ],
72+ 'test': [
73+ ],
74+ 'active' : False,
75+ 'installable' : True,
76+ 'data' : [],
77+}
78+
79+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
80
81=== added file 'sisb_codigo_trabajador/codigo_trabajador.py'
82--- sisb_codigo_trabajador/codigo_trabajador.py 1970-01-01 00:00:00 +0000
83+++ sisb_codigo_trabajador/codigo_trabajador.py 2013-08-20 21:03:31 +0000
84@@ -0,0 +1,53 @@
85+#-*- coding:utf-8 -*-
86+
87+from time import strftime
88+from datetime import date
89+from datetime import datetime
90+from datetime import timedelta
91+import re
92+from dateutil import relativedelta
93+import netsvc
94+from osv import fields, osv
95+import tools
96+from tools.translate import _
97+import logging
98+from itertools import groupby
99+from operator import itemgetter
100+
101+class hr_sede(osv.osv):
102+ '''
103+ Sedes
104+ '''
105+ _inherit = 'hr.sede'
106+ _description = 'Sedes'
107+
108+ _columns = {
109+ 'secuencia_id': fields.many2one('ir.sequence', 'Secuencia codigo\
110+ trabajadores'),
111+ }
112+
113+hr_sede()
114+
115+class hr_employee(osv.osv):
116+ '''
117+ Employee
118+ '''
119+ _inherit = 'hr.employee'
120+ _description = 'Employee'
121+
122+ def create(self, cr, uid, vals, context=None):
123+ if context is None:
124+ context = {}
125+
126+ sede = self.pool.get('hr.sede').browse(cr, uid, vals['hr_sede_id'])
127+ if not sede.secuencia_id:
128+ raise osv.except_osv(_('ERROR!'),_('La Sede seleccionada\
129+ no tiene una secuencia para la generación del código\
130+ del trabajador'))
131+
132+ seq = self.pool.get('ir.sequence').get(cr, uid, sede.secuencia_id.code)
133+ vals.update({'cod_number':seq})
134+ res = super(hr_employee, self).create(cr, uid, vals, context)
135+ return res
136+
137+hr_employee()
138
139=== added directory 'sisb_codigo_trabajador/data'
140=== added directory 'sisb_codigo_trabajador/i18n'
141=== added directory 'sisb_codigo_trabajador/images'
142=== added directory 'sisb_codigo_trabajador/report'
143=== added directory 'sisb_codigo_trabajador/security'
144=== added directory 'sisb_codigo_trabajador/static'
145=== added directory 'sisb_codigo_trabajador/static/src'
146=== added directory 'sisb_codigo_trabajador/static/src/img'
147=== added file 'sisb_codigo_trabajador/static/src/img/icon.png'
148Binary files sisb_codigo_trabajador/static/src/img/icon.png 1970-01-01 00:00:00 +0000 and sisb_codigo_trabajador/static/src/img/icon.png 2013-08-20 21:03:31 +0000 differ
149=== added directory 'sisb_codigo_trabajador/test'
150=== added directory 'sisb_codigo_trabajador/view'
151=== added file 'sisb_codigo_trabajador/view/codigo_trabajador_view.xml'
152--- sisb_codigo_trabajador/view/codigo_trabajador_view.xml 1970-01-01 00:00:00 +0000
153+++ sisb_codigo_trabajador/view/codigo_trabajador_view.xml 2013-08-20 21:03:31 +0000
154@@ -0,0 +1,31 @@
155+<?xml version="1.0" encoding="utf-8"?>
156+<openerp>
157+ <data>
158+
159+ <record id="hr_sede_form_inherit" model="ir.ui.view">
160+ <field name="name">hr.sede.form.inherit</field>
161+ <field name="model">hr.sede</field>
162+ <field name="type">form</field>
163+ <field name="inherit_id" ref="sisb_nomina.hr_sede_form" />
164+ <field name="arch" type="xml">
165+ <xpath expr='/form/notebook/page/field[@name="amount_payment_2"]' position='after'>
166+ <separator string='Secuencia Código Trabajadores'/>
167+ <field name="secuencia_id"/>
168+ </xpath>
169+ </field>
170+ </record>
171+
172+ <record id="view_employee_form_codigo_inherit" model="ir.ui.view">
173+ <field name="name">view.employee.form.codigo.inherit</field>
174+ <field name="model">hr.employee</field>
175+ <field name="type">form</field>
176+ <field name="inherit_id" ref="sisb_nomina.view_employee_form_inherit" />
177+ <field name="arch" type="xml">
178+ <xpath expr='/form/group/group/field[@name="cod_number"]' position='replace'>
179+ <field name="cod_number" readonly='True'/>
180+ </xpath>
181+ </field>
182+ </record>
183+
184+ </data>
185+</openerp>
186
187=== added directory 'sisb_codigo_trabajador/wizard'
188=== modified file 'sisb_nomina/hr_shift_rotation.py'
189--- sisb_nomina/hr_shift_rotation.py 2013-07-12 14:21:52 +0000
190+++ sisb_nomina/hr_shift_rotation.py 2013-08-20 21:03:31 +0000
191@@ -276,7 +276,7 @@
192 }
193 shift_week = self.pool.get('hr.shift.week').create(cr, uid, vals_shift_week)
194
195- return True
196+ return employee
197
198 def write(self, cr, uid, ids, vals, context=None):
199 if context is None:

Subscribers

People subscribed via source and target branches