소스 검색

Agregar en la factura para registrar reclamos de pagos o eventos.

sebas 3 년 전
커밋
e9a73a73b5
8개의 변경된 파일147개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      __init__.py
  2. 38 0
      __openerp__.py
  3. 11 0
      account_invoice.py
  4. 16 0
      account_invoice.xml
  5. 10 0
      calendar_event.py
  6. 49 0
      calendar_event.xml
  7. 18 0
      menu.xml
  8. BIN
      static/description/icon.png

+ 5 - 0
__init__.py

@@ -0,0 +1,5 @@
+# -*- coding: utf-8 -*-
+# © 2016 Therp BV <http://therp.nl>
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+import account_invoice
+import calendar_event

+ 38 - 0
__openerp__.py

@@ -0,0 +1,38 @@
+# -*- 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': 'Calendario de eventos en las facturas de venta',
+    'version': '8.1',
+    'category': 'Account',
+    'description': """Permite adjuntar eventos relacionadas con las facturas de ventas a la propia factura.""",
+    'author': 'Eiru Software/Sebastian Penayo',
+    'website': 'http://www.eirusoftware.com/',
+    'depends': ['account','calendar'],
+    'data': [
+            'menu.xml',
+            'calendar_event.xml',
+            'account_invoice.xml',
+    ],
+    'installable': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 11 - 0
account_invoice.py

@@ -0,0 +1,11 @@
+# -*- coding: utf-8 -*-
+# © 2016 Therp BV <http://therp.nl>
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+from openerp import fields, models
+
+
+class AccountInvoice(models.Model):
+    _inherit = 'account.invoice'
+
+    calendar_event_ids = fields.One2many(
+        'calendar.event', 'account_invoice_id', string='Anotaciones')

+ 16 - 0
account_invoice.xml

@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <record id="view_order_invoice_form" model="ir.ui.view">
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_form" />
+            <field name="arch" type="xml">
+                <xpath expr="//notebook" position="inside">
+                    <page name="account_invoice_calendar_event" string="Reclamos de cobro">
+                        <field name="calendar_event_ids" context="{'default_partner_ids': message_follower_ids, 'default_name': name, 'default_start_datetime': time.strftime('%Y-%m-%d %H:00:00'), 'default_stop_datetime': time.strftime('%Y-%m-%d %H:00:00')}" />
+                    </page>
+                </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>

+ 10 - 0
calendar_event.py

@@ -0,0 +1,10 @@
+# -*- coding: utf-8 -*-
+# © 2016 Therp BV <http://therp.nl>
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+from openerp import fields, models
+
+
+class CalendarEvent(models.Model):
+    _inherit = 'calendar.event'
+
+    account_invoice_id = fields.Many2one('account.invoice', string='Referencia de Factura')

+ 49 - 0
calendar_event.xml

@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <record id="view_calendar_event_search" model="ir.ui.view">
+            <field name="model">calendar.event</field>
+            <field name="inherit_id" ref="calendar.view_calendar_event_search" />
+            <field name="arch" type="xml">
+                <xpath expr="." position="inside">
+                    <field name="account_invoice_id" />
+                    <filter name="account_invoices" string="Facturas" domain="[('account_invoice_id', '!=', False)]" />
+                </xpath>
+            </field>
+        </record>
+        <record id="view_calendar_event_calendar" model="ir.ui.view">
+            <field name="model">calendar.event</field>
+            <field name="inherit_id" ref="calendar.view_calendar_event_calendar" />
+            <field name="arch" type="xml">
+
+                <xpath expr="." position="inside">
+                    <field name="account_invoice_id" />
+                    <!-- <field name="location" position="attributes">
+                        <attribute name="invisible">1</attribute>
+                    </field> -->
+                </xpath>
+            </field>
+        </record>
+        <record id="view_calendar_event_form" model="ir.ui.view">
+            <field name="model">calendar.event</field>
+            <field name="inherit_id" ref="calendar.view_calendar_event_form" />
+            <field name="arch" type="xml">
+                <page string="Misc" position="inside">
+                    <label for="account_invoice_id" />
+                    <field name="account_invoice_id" />
+                </page>
+            </field>
+        </record>
+        <record id="view_calendar_event_form_popup" model="ir.ui.view">
+            <field name="model">calendar.event</field>
+            <field name="inherit_id" ref="calendar.view_calendar_event_form_popup" />
+            <field name="arch" type="xml">
+                <xpath expr="//group" position="inside">
+                    <group name="account_invoice_calendar_event">
+                        <field name="account_invoice_id" />
+                    </group>
+                </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>

+ 18 - 0
menu.xml

@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <act_window
+            id="action_invoice_calendar"
+            name="Reclamos de pago"
+            res_model="calendar.event"
+            view_mode="calendar,tree,form,gantt"
+            domain="[('account_invoice_id', '!=', False)]"
+        />
+        <menuitem
+            id="menu_invoice_calendar"
+            action="action_invoice_calendar"
+            parent="account.menu_finance_receivables"
+            sequence="7"
+        />
+    </data>
+</openerp>

BIN
static/description/icon.png