Explorar o código

Campos extras en el formulario clientes

sebas %!s(int64=5) %!d(string=hai) anos
achega
c569f88ac8
Modificáronse 7 ficheiros con 147 adicións e 0 borrados
  1. 24 0
      __init__.py
  2. BIN=BIN
      __init__.pyc
  3. 32 0
      __openerp__.py
  4. 60 0
      partner_extra_data.py
  5. BIN=BIN
      partner_extra_data.pyc
  6. 31 0
      partner_extra_data_view.xml
  7. BIN=BIN
      static/description/icon.png

+ 24 - 0
__init__.py

@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+import partner_extra_data
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+

BIN=BIN
__init__.pyc


+ 32 - 0
__openerp__.py

@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+
+{
+    'name': 'Partner Extra Data Basic',
+    'version': '2.0',
+    'category': 'Tools',
+    'author': 'Eiru Software/Victor Obrist, Rodney Enciso Arias',
+    'depends': ['base','web_widget_datepicker_options'],
+    'data': ['partner_extra_data_view.xml'],
+    'installable': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 60 - 0
partner_extra_data.py

@@ -0,0 +1,60 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    OpenERP, Open Source Management Solution
+#    Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
+#
+#    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 <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from openerp import models, fields, tools, api, _
+
+class res_partner(models.Model):
+    _name = 'res.partner'
+    _inherit = 'res.partner'
+    _description = 'Add extra data media to Partner'
+
+    #informacion personal basica
+    ruc = fields.Char('R.U.C./C.I.', size=12, required=True)
+    # email = fields.Char('Email')
+    phone = fields.Char('Telefono')
+    mobile = fields.Char('Movil')
+
+    sexo = fields.Selection([('femenino','Femenino'),('masculino','Masculino')],'Sexo', required=True)
+    fecha_nac = fields.Date('Fecha de Nacimiento')
+    estado_civil = fields.Selection([('soltero','Soltero/a'),('casado','Casado/a'),('divorciado','Divorciado/a'),('viudo','Viudo/a')],'Estado Civil')
+
+    #direccion
+    barrio = fields.Char('Barrio')
+
+    # #informacion trabajo
+    trab_cargo = fields.Char('Cargo')
+    trab_empresa = fields.Char('Empresa')
+    trab_telefono = fields.Char('Telefono')
+    trab_antiguedad = fields.Integer('Antiguedad', size=2)
+    trab_antiguedad_a = fields.Integer('Antiguedad años', size=2)
+    trab_antiguedad_m = fields.Integer('Antiguedad meses', size=2)
+    trab_salario = fields.Float('Salario')
+    trab_salario_bonif = fields.Float('Comisión')
+
+    #direccion laboral
+    trab_street = fields.Char('Dirección Laboral')
+    trab_city = fields.Char('Ciudad donde trabaja')
+    ubicacion = fields.Char('Ubicación Google Map')
+
+
+    _sql_constraints = [
+        ('ruc_uniq', 'unique (ruc)', 'El número de R.U.C./C.I. debe ser único!')
+    ]

BIN=BIN
partner_extra_data.pyc


+ 31 - 0
partner_extra_data_view.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="res_partner_ruc">
+            <field name="name">res.partner.ruc</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_partner_form"/>
+            <field name="arch" type="xml">
+                <field name="function" position="before">
+                    <field name="ruc" attrs="{'invisible':[('customer','=',False),('supplier','=',False)],'required':['|',('customer','!=',False),('supplier','!=',False)]}"/>
+                    <field name="sexo" attrs="{'invisible':[('is_company','=',True)],'required':[('is_company','=',False)]}"/>
+                    <field name="fecha_nac" attrs="{'invisible':[('is_company','=',True)]}" options="{'datepicker':{'yearRange': 'c-60:c+0'}}"/>
+                    <field name="ubicacion" widget="url"/>
+                </field>
+                <button name="open_parent" position="replace">
+                    <button name="open_parent" type="object" string="Editar Dirección" class="oe_link oe_edit_only" invisible="1"/>
+                </button>
+            </field>
+        </record>
+        <record id="res_partner_extra_data_search" model="ir.ui.view">
+            <field name="name">res.partner.extra.data.search</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_res_partner_filter"/>
+            <field name="arch" type="xml">
+                <field name="name" position="before">
+                    <field name="ruc" filter_domain="['|','|','|','|',('ruc','ilike',self),('name','ilike',self),('mobile','ilike',self),('phone','ilike',self),('email','ilike',self)]" string="general"/>
+                </field>
+            </field>
+        </record>
+    </data>
+</openerp>

BIN=BIN
static/description/icon.png