Przeglądaj źródła

Afiliados en contracto

sebas 4 lat temu
commit
2772e7a67e

+ 23 - 0
__init__.py

@@ -0,0 +1,23 @@
+# -*- 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_contract
+# 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','account_analytic_analysis','partner_extra_data_basic'],
+    'data': ['partner_extra_data_contract_view.xml'],
+    'installable': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 50 - 0
partner_extra_data_contract.py

@@ -0,0 +1,50 @@
+# -*- 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_affiliate(models.Model):
+    _inherit = 'account.analytic.account'
+
+
+
+    affiliate_ids = fields.One2many(
+        comodel_name='account.analytic.account.affiliate',
+        inverse_name='affiliate_id',
+        string='Lista de afiliados'
+    )
+
+class AffiliateLine(models.Model):
+    _name = 'account.analytic.account.affiliate'
+    _description = 'Clientes to contract'
+    _inherit = ['mail.thread', 'ir.needaction_mixin']
+
+    affiliate_id = fields.Many2one(
+        comodel_name='account.analytic.account',
+        string='Afiliados')
+
+    partner_id = fields.Many2one(
+        comodel_name='res.partner',
+        string='Cliente'
+    )
+    ruc = fields.Char(string='C.I/RUC Nº')
+    mobile = fields.Char(string='Celular')
+    phone = fields.Char(string="Teléfono")

+ 83 - 0
partner_extra_data_contract_view.xml

@@ -0,0 +1,83 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record id="res_partner_extra_data_contract" model="ir.ui.view">
+            <field name="name">res.partner.extra.data.contract</field>
+            <field name="model">account.analytic.account</field>
+            <field name="inherit_id" ref="analytic.view_account_analytic_account_form"/>
+            <field name="arch" type="xml">
+                <page string="Contract Information" position="after">
+                    <page name="affiliate" string="Afiliados">
+
+                        <group name="affiliate" string="Afiliados">
+                            <field name="affiliate_ids" nolabel="1" mode="tree">
+                                <tree string="Referencias Afiliados">
+                                    <field name="partner_id"/>
+                                    <field name="ruc"/>
+                                    <field name="phone"/>
+                                    <field name="mobile"/>
+                                </tree>
+                            </field>
+                       </group>
+                    </page>
+                </page>
+
+
+            </field>
+        </record>
+
+        <record id="tree_account_analytic_account_affiliate" model="ir.ui.view">
+            <field name="name">account.analytic.account.affiliate.tree</field>
+            <field name="model">account.analytic.account.affiliate</field>
+            <field name="arch" type="xml">
+                <tree string="Afiliados" editable="bottom">
+                    <field name="partner_id"/>
+                    <field name="ruc"/>
+                    <field name="mobile"/>
+                    <field name="phone"/>
+                </tree>
+            </field>
+        </record>
+
+        <record id="search_account_analytic_account_affiliate" model="ir.ui.view">
+            <field name="name">account.analytic.account.affiliate.search</field>
+            <field name="model">account.analytic.account.affiliate</field>
+            <field name="arch" type="xml">
+                <search string="Afiliados">
+                    <field name="partner_id"/>
+                    <field name="ruc"/>
+                    <field name="mobile"/>
+                    <field name="phone"/>
+                </search>
+            </field>
+        </record>
+
+        <record id="form_account_analytic_account_affiliate" model="ir.ui.view">
+            <field name="name">account.analytic.account.affiliate.form</field>
+            <field name="model">account.analytic.account.affiliate</field>
+            <field name="arch" type="xml">
+                <form string="Afiliados">
+                    <sheet>
+                        <group>
+                            <field name="partner_id"/>
+                            <field name="ruc"/>
+                            <field name="mobile"/>
+                            <field name="phone"/>
+                        </group>
+                    </sheet>
+                </form>
+            </field>
+        </record>
+
+        <record id="action_account_analytic_account_affiliate" model="ir.actions.act_window">
+            <field name="name">Afiliados</field>
+            <field name="type">ir.actions.act_window</field>
+            <field name="res_model">account.analytic.account.affiliate</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+            <field name="search_view_id" ref="search_account_analytic_account_affiliate"/>
+        </record>
+
+
+    </data>
+</openerp>

BIN
static/description/icon.png