Przeglądaj źródła

Crea campos extras en clientes relacionados a familiares

Sebas 5 lat temu
commit
774c73b43b

+ 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_family
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+

BIN
__init__.pyc


+ 34 - 0
__openerp__.py

@@ -0,0 +1,34 @@
+# -*- 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': 'Partners Extra Data Family',
+    'version': '2.1',
+    'category': 'Tools',
+    'description': """This module allows to add extra fields to the partners of family.""",
+    'author': 'Eiru Software/Sebastian Penayo',
+    'website': 'http://www.eirusoftware.com/',
+    'depends': ['base','partner_extra_data_basic'],
+    'data': ['partner_extra_data_family_view.xml'],
+    'installable': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 31 - 0
partner_extra_data_family.py

@@ -0,0 +1,31 @@
+# -*- 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_partner1(models.Model):
+    _name = 'res.partner'
+    _inherit = 'res.partner'
+    _description = 'Add extra data media to Partner for Family'
+
+    tipo_family = fields.Char('Lazo familiar')
+    ref_family_ids = fields.Many2many('res.partner', 'res_partner_family', 'parent_id', 'partner_id', string='Referencia Familiar',domain=[('active','=',True),('is_family_reference','=',True)])
+    is_family_reference = fields.Boolean('Es una referencia familiar', help="Marca el contacto si es una referencia familiar")

BIN
partner_extra_data_family.pyc


+ 63 - 0
partner_extra_data_family_view.xml

@@ -0,0 +1,63 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record id="res_partner_extra_data_family" model="ir.ui.view">
+            <field name="name">res.partner.extra.data.family</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_partner_form"/>
+            <field name="arch" type="xml">
+                <page string="Internal Notes" position="before">
+                    <page name="family" string="Referencia Familiar" attrs="{'invisible':[('is_company','=',True)]}">
+                        <group name="Domicilio">
+                            <group name="Referencia familiar">
+                                <group name="datos_referencia" col="2" string="Tipo de Referencia">
+                                    <field name="is_family_reference" string="Es una referencia familiar"/>
+                                </group>
+                            </group>
+                        </group>
+                        <group name="familiares" string="Referencias Familiares">
+                            <field name="ref_family_ids" nolabel="1" mode="tree" context="{'default_customer': True, 'default_is_family_reference': False}">
+                                <tree string="Referencias Familiares">
+                                    <field name="name"/>
+                                    <field name="tipo_family"/>
+                                    <field name="fecha_nac"/>
+                                    <field name="phone"/>
+                                    <field name="mobile"/>
+                                </tree>
+                            </field>
+                       </group>
+                    </page>
+                </page>
+
+                <field name="email" position="after">
+                    <field name="tipo_family" attrs="{'invisible':[('is_company','=',True)]}"/>
+                </field>
+
+				<!-- <field name="phone" position="before">
+                    <field name="estado_civil" attrs="{'invisible':[('is_company','=',True)]}"/>
+                </field> -->
+                <field name="function" position="replace">
+					<field name="function" invisible="1"/>
+                </field>
+                <field name="title" position="replace">
+					<field name="title" invisible="1"/>
+                </field>
+                <field name="user_id" position="after">
+					<field name="create_uid" readonly="1"/>
+                </field>
+            </field>
+        </record>
+
+        <!-- <record id="res_partner_extra_data_search_family" model="ir.ui.view">
+            <field name="name">res.partner.extra.data.family.search</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_res_partner_filter"/>
+            <field name="arch" type="xml">
+
+                <filter name="supplier" position="after">
+                    <filter string="Referencias Familiares" name="type_family_reference"/>
+                </filter>
+            </field>
+        </record> -->
+    </data>
+</openerp>

BIN
static/description/icon.png