Quellcode durchsuchen

Agrega un nuevo campo seq_invoice en account_invoice, sirve para guardar la secuencia de diario al cancelar una factura.

sebas vor 3 Jahren
Commit
f33a13b7b6

+ 3 - 0
__init__.py

@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+
+from . import models

BIN
__init__.pyc


+ 24 - 0
__openerp__.py

@@ -0,0 +1,24 @@
+# -*- coding: utf-8 -*-
+{
+    'name': 'Anadir campo secuencial para Ñande TV',
+    'summary': 'Anadir campo secuencial para Ñande TV',
+    'category': 'extra',
+    'version': '0.1',
+    'description': """
+    """,
+    'author': 'Eiru Software',
+    'website': 'https://www.eiru.com.py',
+    'depends': [
+        'base',
+        'account',
+        'sale',
+    ],
+    'data': [
+        'views/account_invoice_view.xml',
+        'views/account_voucher_view.xml',
+        'data/sequence.xml'
+    ],
+    'test': [
+    ],
+    'installable': True,
+}

+ 20 - 0
data/sequence.xml

@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data noupdate="1">
+
+        <!-- Sequences for Ñande TV-->
+        <record id="seq_type_invoice_id" model="ir.sequence.type">
+            <field name="name">Secuencia Ñande TV</field>
+            <field name="code">account.invoice</field>
+        </record>
+
+        <record id="seq_invoice_id" model="ir.sequence">
+            <field name="name">Secuencia Ñande TV</field>
+            <field name="code">account.invoice</field>
+            <field name="prefix">- </field>
+            <field name="padding">6</field>
+            <field name="company_id" eval="False"/>
+        </record>
+
+    </data>
+</openerp>

+ 3 - 0
models/__init__.py

@@ -0,0 +1,3 @@
+# -*- coding: utf-8 -*-
+
+from . import account_invoice, account_voucher

+ 9 - 0
models/account_invoice.py

@@ -0,0 +1,9 @@
+# -*- coding: utf-8 -*-
+
+from openerp import api, models, fields
+
+class account_invoice(models.Model):
+    _inherit = "account.invoice"
+    _name = 'account.invoice'
+
+    seq_invoice = fields.Char(string='Secuencia', related='internal_number', store = True)

+ 25 - 0
models/account_voucher.py

@@ -0,0 +1,25 @@
+# -*- encoding: utf-8 -*-
+#################################################################################
+#                                                                               #
+#    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, api
+
+class account_voucher(models.Model):
+    _inherit = 'account.voucher'
+    _name = 'account.voucher'
+
+    seq_invoice = fields.Char('Secuencia Ñande TV')

+ 29 - 0
views/account_invoice_view.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<openerp>
+    <data>
+
+        <record id="account_invoiced_voucher_view" model="ir.ui.view">
+            <field name="name">account.invoiced.voucher.view</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.invoice_tree" />
+            <field name="arch" type="xml">
+                <field name="date_invoice" position="before">
+                        <field name="seq_invoice"/>
+                </field>
+            </field>
+        </record>
+
+        <record id="view_accountinvoices_filter_search2" model="ir.ui.view">
+            <field name="name">accountinvoices.filter.search2</field>
+            <field name="model">account.invoice</field>
+            <field name="inherit_id" ref="account.view_account_invoice_filter" />
+            <field name="arch" type="xml">
+              <search>
+                   <field name="seq_invoice" string="Secuencia"/>
+               </search>
+            </field>
+        </record>
+
+    </data>
+</openerp>

+ 27 - 0
views/account_voucher_view.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+  <data>
+    <record model="ir.ui.view" id="sequence_voucher_form">
+      <field name="name">sequence_voucher_form</field>
+      <field name="model">account.voucher</field>
+      <field name="inherit_id" ref="account_voucher.view_vendor_receipt_form"/>
+      <field name="arch" type="xml">
+      <field name="journal_id" position="before">
+          <field name="seq_invoice"/>
+          </field>
+      </field>
+    </record>
+
+    <record id="account_voucherseq_tree_view" model="ir.ui.view">
+        <field name="name">account.voucherseq.tree.view</field>
+        <field name="model">account.voucher</field>
+        <field name="inherit_id" ref="account_voucher.view_voucher_tree"/>
+        <field name="arch" type="xml">
+            <field name="reference" position="after">
+                <field name="seq_invoice"/>
+            </field>
+        </field>
+    </record>
+    
+ </data>
+</openerp>