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
=== added directory 'sisb_codigo_trabajador'
=== added file 'sisb_codigo_trabajador/__init__.py'
--- sisb_codigo_trabajador/__init__.py 1970-01-01 00:00:00 +0000
+++ sisb_codigo_trabajador/__init__.py 2013-08-20 21:03:31 +0000
@@ -0,0 +1,24 @@
1#-*- coding:utf-8 -*-
2##############################################################################
3#
4# SISB, Sistema Integral Simón Bolivar
5# Copyright (C) 2012-2013 Industrias Diana, C.A. All Rights Reserved
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21
22import codigo_trabajador
23
24# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
025
=== added file 'sisb_codigo_trabajador/__openerp__.py'
--- sisb_codigo_trabajador/__openerp__.py 1970-01-01 00:00:00 +0000
+++ sisb_codigo_trabajador/__openerp__.py 2013-08-20 21:03:31 +0000
@@ -0,0 +1,45 @@
1#-*- coding:utf-8 -*-
2##############################################################################
3#
4# SISB, Sistema Integral Simón Bolivar
5# Copyright (C) 2012-2013 Industrias Diana, C.A. All Rights Reserved
6#
7# This program is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Affero General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Affero General Public License for more details.
16#
17# You should have received a copy of the GNU Affero General Public License
18# along with this program. If not, see <http://www.gnu.org/licenses/>.
19#
20##############################################################################
21{
22 'name': 'Codigo Trabajador',
23 'version': '1.0',
24 'category': 'Talento Humano',
25 "sequence": 38,
26 'complexity': "normal",
27 'description': """ """,
28 'author':'Industrias Diana C.A.',
29 'website':'http://www.industriasdiana.gob.ve',
30 'depends': [
31 'sisb_nomina',
32 ],
33 'init_xml': [
34 ],
35 'update_xml': [
36 'view/codigo_trabajador_view.xml',
37 ],
38 'test': [
39 ],
40 'active' : False,
41 'installable' : True,
42 'data' : [],
43}
44
45# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
046
=== added file 'sisb_codigo_trabajador/codigo_trabajador.py'
--- sisb_codigo_trabajador/codigo_trabajador.py 1970-01-01 00:00:00 +0000
+++ sisb_codigo_trabajador/codigo_trabajador.py 2013-08-20 21:03:31 +0000
@@ -0,0 +1,53 @@
1#-*- coding:utf-8 -*-
2
3from time import strftime
4from datetime import date
5from datetime import datetime
6from datetime import timedelta
7import re
8from dateutil import relativedelta
9import netsvc
10from osv import fields, osv
11import tools
12from tools.translate import _
13import logging
14from itertools import groupby
15from operator import itemgetter
16
17class hr_sede(osv.osv):
18 '''
19 Sedes
20 '''
21 _inherit = 'hr.sede'
22 _description = 'Sedes'
23
24 _columns = {
25 'secuencia_id': fields.many2one('ir.sequence', 'Secuencia codigo\
26 trabajadores'),
27 }
28
29hr_sede()
30
31class hr_employee(osv.osv):
32 '''
33 Employee
34 '''
35 _inherit = 'hr.employee'
36 _description = 'Employee'
37
38 def create(self, cr, uid, vals, context=None):
39 if context is None:
40 context = {}
41
42 sede = self.pool.get('hr.sede').browse(cr, uid, vals['hr_sede_id'])
43 if not sede.secuencia_id:
44 raise osv.except_osv(_('ERROR!'),_('La Sede seleccionada\
45 no tiene una secuencia para la generación del código\
46 del trabajador'))
47
48 seq = self.pool.get('ir.sequence').get(cr, uid, sede.secuencia_id.code)
49 vals.update({'cod_number':seq})
50 res = super(hr_employee, self).create(cr, uid, vals, context)
51 return res
52
53hr_employee()
054
=== added directory 'sisb_codigo_trabajador/data'
=== added directory 'sisb_codigo_trabajador/i18n'
=== added directory 'sisb_codigo_trabajador/images'
=== added directory 'sisb_codigo_trabajador/report'
=== added directory 'sisb_codigo_trabajador/security'
=== added directory 'sisb_codigo_trabajador/static'
=== added directory 'sisb_codigo_trabajador/static/src'
=== added directory 'sisb_codigo_trabajador/static/src/img'
=== added file 'sisb_codigo_trabajador/static/src/img/icon.png'
1Binary 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 differ55Binary 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
=== added directory 'sisb_codigo_trabajador/test'
=== added directory 'sisb_codigo_trabajador/view'
=== added file 'sisb_codigo_trabajador/view/codigo_trabajador_view.xml'
--- sisb_codigo_trabajador/view/codigo_trabajador_view.xml 1970-01-01 00:00:00 +0000
+++ sisb_codigo_trabajador/view/codigo_trabajador_view.xml 2013-08-20 21:03:31 +0000
@@ -0,0 +1,31 @@
1<?xml version="1.0" encoding="utf-8"?>
2<openerp>
3 <data>
4
5 <record id="hr_sede_form_inherit" model="ir.ui.view">
6 <field name="name">hr.sede.form.inherit</field>
7 <field name="model">hr.sede</field>
8 <field name="type">form</field>
9 <field name="inherit_id" ref="sisb_nomina.hr_sede_form" />
10 <field name="arch" type="xml">
11 <xpath expr='/form/notebook/page/field[@name="amount_payment_2"]' position='after'>
12 <separator string='Secuencia Código Trabajadores'/>
13 <field name="secuencia_id"/>
14 </xpath>
15 </field>
16 </record>
17
18 <record id="view_employee_form_codigo_inherit" model="ir.ui.view">
19 <field name="name">view.employee.form.codigo.inherit</field>
20 <field name="model">hr.employee</field>
21 <field name="type">form</field>
22 <field name="inherit_id" ref="sisb_nomina.view_employee_form_inherit" />
23 <field name="arch" type="xml">
24 <xpath expr='/form/group/group/field[@name="cod_number"]' position='replace'>
25 <field name="cod_number" readonly='True'/>
26 </xpath>
27 </field>
28 </record>
29
30 </data>
31</openerp>
032
=== added directory 'sisb_codigo_trabajador/wizard'
=== modified file 'sisb_nomina/hr_shift_rotation.py'
--- sisb_nomina/hr_shift_rotation.py 2013-07-12 14:21:52 +0000
+++ sisb_nomina/hr_shift_rotation.py 2013-08-20 21:03:31 +0000
@@ -276,7 +276,7 @@
276 }276 }
277 shift_week = self.pool.get('hr.shift.week').create(cr, uid, vals_shift_week)277 shift_week = self.pool.get('hr.shift.week').create(cr, uid, vals_shift_week)
278278
279 return True279 return employee
280280
281 def write(self, cr, uid, ids, vals, context=None):281 def write(self, cr, uid, ids, vals, context=None):
282 if context is None:282 if context is None:

Subscribers

People subscribed via source and target branches