ソースを参照

Módulo añade la lista de pedidos de venta relacionados con esta factura

SEBAS 1 年間 前
コミット
c8cfff053d
6 ファイル変更130 行追加0 行削除
  1. 23 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 46 0
      __openerp__.py
  4. 36 0
      account_invoice.py
  5. BIN
      account_invoice.pyc
  6. 25 0
      account_invoice_view.xml

+ 23 - 0
__init__.py

@@ -0,0 +1,23 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Account Invoice Sale Link module for OpenERP
+#    Copyright (C) 2013 Akretion (http://www.akretion.com)
+#    @author Alexis de Lattre <alexis.delattre@akretion.com>
+#
+#    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 . import account_invoice

BIN
__init__.pyc


+ 46 - 0
__openerp__.py

@@ -0,0 +1,46 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Account Invoice Sale Link module for OpenERP
+#    Copyright (C) 2013 Akretion (http://www.akretion.com)
+#    @author Alexis de Lattre <alexis.delattre@akretion.com>
+#
+#    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': 'Account Invoice Sale Link',
+    'version': '0.1',
+    'category': 'Accounting & Finance',
+    'license': 'AGPL-3',
+    'summary': 'Add the reverse link from invoices to sale orders',
+    'description': """
+Account Invoice Sale Link
+=========================
+
+On the customer invoice report, you usually need to display the customer order number. For that, you need to have the link from invoices to sale orders, and this link is not available in the official addons.
+
+This module adds a field *sale_ids* on the object account.invoice, which is the reverse many2many field of the field *invoice_ids* of the object sale.order. It is displayed in a dedicated tab on the invoice form view.
+
+Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com> for any help or question about this module.
+    """,
+    'author': 'Akretion',
+    'website': 'http://www.akretion.com',
+    'depends': ['sale'],
+    'data': ['account_invoice_view.xml'],
+    'installable': True,
+    'active': False,
+}

+ 36 - 0
account_invoice.py

@@ -0,0 +1,36 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    Account Invoice Sale Link module for OpenERP
+#    Copyright (C) 2013 Akretion (http://www.akretion.com)
+#    @author Alexis de Lattre <alexis.delattre@akretion.com>
+#
+#    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.osv import orm, fields
+
+
+class account_invoice(orm.Model):
+    _inherit = 'account.invoice'
+
+    _columns = {
+        # This is the reverse link of the field 'invoice_ids' of sale.order
+        # defined in addons/sale/sale.py
+        'sale_ids': fields.many2many(
+            'sale.order', 'sale_order_invoice_rel', 'invoice_id',
+            'order_id', 'Pedidos de venta', readonly=True,
+            help="Esta es la lista de pedidos de venta relacionados con esta factura."),
+        }

BIN
account_invoice.pyc


+ 25 - 0
account_invoice_view.xml

@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+   Copyright (C) 2014 Akretion (http://www.akretion.com/)
+   @author: Alexis de Lattre <alexis.delattre@akretion.com>
+   The licence is in the file __openerp__.py
+-->
+
+<openerp>
+<data>
+
+<record id="invoice_form" model="ir.ui.view">
+    <field name="name">account_invoice_sale_link.invoice.form</field>
+    <field name="model">account.invoice</field>
+    <field name="inherit_id" ref="account.invoice_form"/>
+    <field name="arch" type="xml">
+        <notebook position="inside">
+            <page name="sale_ids" string="Pedidos de ventas">
+                <field name="sale_ids"/>
+            </page>
+        </notebook>
+    </field>
+</record>
+
+</data>
+</openerp>