Parcourir la source

Añade el campo de account.invoice supplier_invoice_number en account.voucher

SEBAS il y a 1 an
commit
4dcd1e9f23

+ 2 - 0
__init__.py

@@ -0,0 +1,2 @@
+# -*- coding: utf-8 -*-
+import models

BIN
__init__.pyc


+ 19 - 0
__openerp__.py

@@ -0,0 +1,19 @@
+# -*- coding ;utf-8 -*-
+{
+    'name': 'Eiru number supplier invoice en voucher',
+    'author':  'Sebastian Penayo',
+    'version': '0.1',
+    'category': 'account',
+    'description': "Modulo para añadir number supplier invoice en vouche.",
+    'depends': [
+        'account',
+    ],
+    'data': [
+        # 'views/account_bank_statement_type.xml',
+        'views/account_voucher_supplier_view.xml',
+    ],
+    'qweb': [
+    ],
+
+    'installable': True,
+}

+ 4 - 0
models/__init__.py

@@ -0,0 +1,4 @@
+# -*- coding: utf-8 -*-
+
+# import account_bank_statement_line
+import account_voucher_supplier

BIN
models/__init__.pyc


+ 36 - 0
models/account_voucher_supplier.py

@@ -0,0 +1,36 @@
+# -*- 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 account_voucher(models.Model):
+    _name = 'account.voucher'
+    _inherit = 'account.voucher'
+    _description = 'Add extra data supplier_invoice_number to voucher recibo'
+
+    supplier_invoice_number = fields.Char(string='Nº de factura del proveedor')
+
+    @api.multi
+    def proforma_voucher(self):
+        res = super(AccountVoucher, self).proforma_voucher()
+        if self.invoice_id:
+            self.supplier_invoice_number = self.invoice_id.supplier_invoice_number
+        return res

BIN
models/account_voucher_supplier.pyc


BIN
static/description/icon.png


+ 17 - 0
views/account_voucher_supplier_view.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record id="account_voucher_supplier_invoice_view" model="ir.ui.view">
+            <field name="name">account.voucher.supplier.invoice</field>
+            <field name="model">account.voucher</field>
+            <field name="inherit_id" ref="account_voucher.view_vendor_payment_form"/>
+            <field name="arch" type="xml">
+                <field name="journal_id" position="after">
+                    <field name="supplier_invoice_number" attrs="{'readonly':True}"/>
+                </field>
+            </field>
+        </record>
+
+
+    </data>
+</openerp>

+ 75 - 0
views/eiru_statement_utility.xml

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+	<data>
+		<!-- Registros de caja -->
+        <record id="eiru_statement_utility_cash" model="ir.ui.view">
+            <field name="name">eiru.statement.utility.cash</field>
+            <field name="model">account.bank.statement</field>
+            <field name="inherit_id" ref="account.view_bank_statement_form2"/>
+            <field name="arch" type="xml">
+				<field name='state' position="before">
+					<div class="eiru-statement-utility" attrs="{'invisible': [('state','!=','open')]}"></div>
+				</field>
+				<field name='state' position="before">
+					<div class="eiru-statement-unlink" attrs="{'invisible': [('state','==','confirm')]}"></div>
+				</field>
+				<!-- open -->
+				<xpath expr="//button[@name='button_open']" position="replace">
+					<div class="eiru-statement-utility-open" states="draft"> </div>
+				</xpath>
+				<!-- confirm -->
+				<xpath expr="//button[@name='button_confirm_cash']" position="replace"></xpath>
+				<!-- Cancel  -->
+				<xpath expr="//button[@name='button_cancel']" position="replace">
+					<div class="eiru-statement-utility-cancel" attrs="{'invisible': [('state','!=','confirm')]}"></div>
+				</xpath>
+				<!-- print -->
+				<field name='state' position="before">
+					<div class="eiru-statement-print" attrs="{'invisible': [('state','!=','confirm')]}"></div>
+				</field>
+
+            </field>
+        </record>
+
+		<!-- button_draft  -->
+		<record id="eiru_statement_utility_cash_cancel" model="ir.ui.view">
+            <field name="name">eiru.statement.utility.cash.cancel</field>
+            <field name="model">account.bank.statement</field>
+            <field name="inherit_id" ref="account_cancel.bank_statement_draft_form_inherit2"/>
+            <field name="arch" type="xml">
+				<xpath expr="//button[@name='button_draft']" position="replace"></xpath>
+            </field>
+        </record>
+
+		<!-- Extractos bancarios -->
+		<record id="eiru_statement_utility_bank" model="ir.ui.view">
+            <field name="name">eiru.statement.utility.bank</field>
+            <field name="model">account.bank.statement</field>
+            <field name="inherit_id" ref="account.view_bank_statement_form"/>
+			<field name="arch" type="xml">
+				<!-- Utility cashbox -->
+				<field name='state' position="before">
+					<div class="eiru-statement-utility" attrs="{'invisible': [('state','!=','open')]}"></div>
+				</field>
+				<!--  Eliminar -->
+				<field name='state' position="before">
+					<div class="eiru-statement-unlink" attrs="{'invisible': [('state','==','confirm')]}"></div>
+				</field>
+				<!-- Cancel cashbox -->
+				<xpath expr="//button[@name='button_cancel']" position="replace">
+					<div class="eiru-statement-utility-cancel" attrs="{'invisible': [('state','!=','confirm')]}"></div>
+				</xpath>
+				<!-- Open cashbox -->
+				<xpath expr="//button[@name='button_confirm_bank']" position="replace">
+					<div class="eiru-statement-utility-open" states="draft"> </div>
+				</xpath>
+				<!-- Resume -->
+				<field name='state' position="before">
+					<div class="eiru-statement-print" attrs="{'invisible': [('state','!=','confirm')]}"></div>
+				</field>
+
+				<xpath expr="//button[@name='button_draft']" position="replace"></xpath>
+            </field>
+        </record>
+	</data>
+</openerp>