Browse Source

Ocultar crear factura y cancelar pedido en Venta.

sebas 3 years ago
commit
8f9e661325
5 changed files with 92 additions and 0 deletions
  1. 4 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 34 0
      __openerp__.py
  4. 10 0
      security/sale_hide_makeinvoice_button_security.xml
  5. 44 0
      views/sale_view.xml

+ 4 - 0
__init__.py

@@ -0,0 +1,4 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+# For copyright and license notices, see __openerp__.py file in root directory
+##############################################################################

BIN
__init__.pyc


+ 34 - 0
__openerp__.py

@@ -0,0 +1,34 @@
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU 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 General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see http://www.gnu.org/licenses/.
+#
+##############################################################################
+
+{
+    "name": "Ocultar crear factura y cancelar pedido en Venta",
+    "version": "1.0",
+    "depends": [
+        "sale",
+    ],
+    "author": "Sebastian Penayo - Eiru Software",
+    "website": "http://www.eiru.com",
+    "category": "Sale",
+    "summary": "",
+    "data": [
+        "security/sale_hide_makeinvoice_button_security.xml",
+        "views/sale_view.xml",
+    ],
+    "installable": True,
+}

+ 10 - 0
security/sale_hide_makeinvoice_button_security.xml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data noupdate="0">
+        <record id="sale.group_hide_makeinvoice_button" model="res.groups">
+            <field name="name">Habilitar (marcado) crear factura y cancelar pedido </field>
+            <field name="category_id" ref="base.module_category_hidden" />
+            <field name="users" eval="[(4, ref('base.user_root'))]"/>
+        </record>
+    </data>
+</openerp>

+ 44 - 0
views/sale_view.xml

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<openerp>
+    <data>
+        <!-- <record model="ir.ui.view" id="stock_picking_disable_button_form_view">
+            <field name="name">stock.picking.disable_button.form</field>
+            <field name="model">stock.picking</field>
+            <field name="inherit_id" ref="stock.view_picking_form" />
+            <field name="arch" type="xml">
+                <button name="force_assign" position="attributes">
+                    <attribute name="groups">stock.group_stock_force_availability</attribute>
+                </button>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="stock_move_disable_button_form_view">
+            <field name="name">stock.move.disable_button.form</field>
+            <field name="model">stock.move</field>
+            <field name="inherit_id" ref="stock.view_move_form" />
+            <field name="arch" type="xml">
+                <button name="force_assign" position="attributes">
+                    <attribute name="groups">stock.group_stock_force_availability</attribute>
+                </button>
+            </field>
+        </record> -->
+
+        <record model="ir.ui.view" id="sale_hide_makeinvoice_button_form_view">
+            <field name="name">sale.sale.hide.makeinvoice.button.form</field>
+            <field name="model">sale.order</field>
+            <field name="inherit_id" ref="sale.view_order_form"/>
+            <field name="arch" type="xml">
+                <!-- <button name="force_assign" position="attributes">
+                    <attribute name="groups">sale.group_stock_force_availability</attribute>
+                </button> -->
+                 <!-- <button name="create_invoice" string="CREATE INVOICE" type="object" class="btn-primary" groups="sale.group_hide_makeinvoice_button"/> -->
+                 <xpath expr="//button[@name='%(sale.action_view_sale_advance_payment_inv)d']" position="attributes">
+                    <attribute name="groups">sale.group_hide_makeinvoice_button</attribute>
+                </xpath>
+                <xpath expr="//header/button[@name='action_cancel']" position="attributes">
+                   <attribute name="groups">sale.group_hide_makeinvoice_button</attribute>
+               </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>