Browse Source

First commit

deisy 5 years ago
commit
ecc93bc17e

+ 6 - 0
__init__.py

@@ -0,0 +1,6 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+# For copyright and license notices, see __openerp__.py file in module root
+# directory
+##############################################################################
+# from . import models

+ 43 - 0
__openerp__.py

@@ -0,0 +1,43 @@
+# -*- coding: utf-8 -*-
+##############################################################################
+#
+#    Copyright (C) 2015  ADHOC SA  (http://www.adhoc.com.ar)
+#    All Rights Reserved.
+#
+#    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': 'Fields Security DIKASA',
+    'version': '8.0.0.2.0',
+    'description': """
+Fields Security
+===============
+Oculta ciertos campos no utilizados en el sistema
+""",
+    'category': 'Sales Management',
+    'author': 'Eiru Software',
+    'website': 'http://www.eiru.com.py/',
+    'license': 'AGPL-3',
+    'depends': [
+        'sale','base','account','purchase','product','stock'
+    ],
+    'data': [
+        'security/views/res_partner.xml',
+    ],
+    'demo_xml': [],
+    'test': [],
+    'installable': True,
+}
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 0 - 0
security/views/purchase.xml


+ 162 - 0
security/views/res_partner.xml

@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+
+      <!-- READONLY PARA base.group_sale_salesman-->
+
+        <record id="readonly_partner_form" model="ir.ui.view">
+            <field name="name">readonly_partner_form</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="base.view_partner_form"/>
+            <field name="groups_id" eval="[(6, 0, [ref('base.group_sale_salesman')])]"/>
+            <field name="arch" type="xml">
+                <xpath expr="//field[@name='user_id']" position="attributes">
+                    <attribute name="readonly">1</attribute>
+                </xpath>
+            </field>
+        </record>
+
+        <record id="readonly_partner_form2" model="ir.ui.view">
+            <field name="name">readonly_partner_form2</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="account.view_partner_property_form"/>
+            <field name="groups_id" eval="[(6, 0, [ref('base.group_sale_salesman')])]"/>
+            <field name="arch" type="xml">
+                <xpath expr="//field[@name='property_account_position']" position="attributes">
+                    <attribute name="readonly">1</attribute>
+                </xpath>
+                <xpath expr="//field[@name='property_account_receivable']" position="attributes">
+                    <attribute name="readonly">1</attribute>
+                </xpath>
+                <xpath expr="//field[@name='property_account_payable']" position="attributes">
+                    <attribute name="readonly">1</attribute>
+                </xpath>
+                <xpath expr="//field[@name='property_payment_term']" position="attributes">
+                    <attribute name="readonly">1</attribute>
+                </xpath>
+
+                <xpath expr="//field[@name='property_supplier_payment_term']" position="attributes">
+                    <attribute name="readonly">1</attribute>
+                </xpath>
+            </field>
+        </record>
+
+        <record id="readonly_partner_form3" model="ir.ui.view">
+            <field name="name">readonly_partner_form3</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="product.view_partner_property_form"/>
+            <field name="groups_id" eval="[(6, 0, [ref('base.group_sale_salesman')])]"/>
+            <field name="arch" type="xml">
+              <xpath expr="//field[@name='property_product_pricelist']" position="attributes">
+                  <attribute name="readonly">1</attribute>
+              </xpath>
+            </field>
+        </record>
+
+        <record id="readonly_partner_form4" model="ir.ui.view">
+            <field name="name">readonly_partner_form4</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="purchase.view_partner_property_form"/>
+            <field name="groups_id" eval="[(6, 0, [ref('base.group_sale_salesman')])]"/>
+            <field name="arch" type="xml">
+              <xpath expr="//field[@name='property_product_pricelist_purchase']" position="attributes">
+                  <attribute name="readonly">1</attribute>
+              </xpath>
+            </field>
+        </record>
+
+        <record id="readonly_partner_form5" model="ir.ui.view">
+            <field name="name">readonly_partner_form5</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="stock.view_partner_property_form"/>
+            <field name="groups_id" eval="[(6, 0, [ref('base.group_sale_salesman')])]"/>
+            <field name="arch" type="xml">
+              <xpath expr="//field[@name='property_stock_customer']" position="attributes">
+                  <attribute name="readonly">1</attribute>
+              </xpath>
+              <xpath expr="//field[@name='property_stock_supplier']" position="attributes">
+                  <attribute name="readonly">1</attribute>
+              </xpath>
+            </field>
+        </record>
+
+        <!-- EDTTABLE PARA  -->
+
+        <record id="editable_partner_form" model="ir.ui.view">
+            <field name="name">editable_partner_form</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="extra_data_dikasa.readonly_partner_form"/>
+            <field name="groups_id" eval="[(6, 0, [ref('base.group_sale_manager')])]"/>
+            <field name="arch" type="xml">
+                <xpath expr="//field[@name='user_id']" position="attributes">
+                    <attribute name="readonly">0</attribute>
+                </xpath>
+            </field>
+        </record>
+
+        <record id="editable_partner_form2" model="ir.ui.view">
+            <field name="name">editable_partner_form2</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="extra_data_dikasa.readonly_partner_form2"/>
+            <field name="groups_id" eval="[(6, 0, [ref('base.group_sale_manager')])]"/>
+            <field name="arch" type="xml">
+                <xpath expr="//field[@name='property_account_position']" position="attributes">
+                    <attribute name="readonly">0</attribute>
+                </xpath>
+                <xpath expr="//field[@name='property_account_receivable']" position="attributes">
+                    <attribute name="readonly">0</attribute>
+                </xpath>
+                <xpath expr="//field[@name='property_account_payable']" position="attributes">
+                    <attribute name="readonly">0</attribute>
+                </xpath>
+                <xpath expr="//field[@name='property_payment_term']" position="attributes">
+                    <attribute name="readonly">0</attribute>
+                </xpath>
+
+                <xpath expr="//field[@name='property_supplier_payment_term']" position="attributes">
+                    <attribute name="readonly">0</attribute>
+                </xpath>
+            </field>
+        </record>
+
+        <record id="editable_partner_form3" model="ir.ui.view">
+            <field name="name">editable_partner_form3</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="extra_data_dikasa.readonly_partner_form3"/>
+            <field name="groups_id" eval="[(6, 0, [ref('base.group_sale_manager')])]"/>
+            <field name="arch" type="xml">
+              <xpath expr="//field[@name='property_product_pricelist']" position="attributes">
+                  <attribute name="readonly">0</attribute>
+              </xpath>
+            </field>
+        </record>
+
+        <record id="editable_partner_form4" model="ir.ui.view">
+            <field name="name">editable_partner_form4</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="extra_data_dikasa.readonly_partner_form4"/>
+            <field name="groups_id" eval="[(6, 0, [ref('base.group_sale_manager')])]"/>
+            <field name="arch" type="xml">
+              <xpath expr="//field[@name='property_product_pricelist_purchase']" position="attributes">
+                  <attribute name="readonly">0</attribute>
+              </xpath>
+            </field>
+        </record>
+
+        <record id="editable_partner_form5" model="ir.ui.view">
+            <field name="name">editable_partner_form5</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="extra_data_dikasa.readonly_partner_form5"/>
+            <field name="groups_id" eval="[(6, 0, [ref('base.group_sale_manager')])]"/>
+            <field name="arch" type="xml">
+              <xpath expr="//field[@name='property_stock_customer']" position="attributes">
+                  <attribute name="readonly">0</attribute>
+              </xpath>
+              <xpath expr="//field[@name='property_stock_supplier']" position="attributes">
+                  <attribute name="readonly">0</attribute>
+              </xpath>
+            </field>
+        </record>
+
+    </data>
+</openerp>

+ 34 - 0
security/views/sale_order.xml

@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <!-- make readonly for everyone -->
+        <record id="view_credit_readonly_partner_form" model="ir.ui.view">
+            <field name="name">res.partner.partner_credit_limit.form</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="account.view_partner_property_form"/>
+            <field name="arch" type="xml">
+                <xpath expr="//form[@string='Partners']//field[@name='credit_limit']" position="attributes">
+                    <attribute name="readonly">1</attribute>
+                </xpath>
+                <xpath expr="//form[@string='Partners']//field[@name='check_limit']" position="attributes">
+                    <attribute name="readonly">1</attribute>
+                </xpath>
+            </field>
+        </record>
+        <!-- Make not readonly for user_edit_credit_limit  -->
+        <record id="view_credit_editable_partner_form" model="ir.ui.view">
+            <field name="name">res.partner.partner_credit_limit.form</field>
+            <field name="model">res.partner</field>
+            <field name="inherit_id" ref="partner_credit_limit.view_credit_readonly_partner_form"/>
+            <field name="groups_id" eval="[(6, 0, [ref('partner_credit_limit.credit_config')])]"/>
+            <field name="arch" type="xml">
+                <xpath expr="//form[@string='Partners']//field[@name='credit_limit']" position="attributes">
+                    <attribute name="readonly">0</attribute>
+                </xpath>
+                <xpath expr="//form[@string='Partners']//field[@name='check_limit']" position="attributes">
+                    <attribute name="readonly">0</attribute>
+                </xpath>
+            </field>
+        </record>
+    </data>
+</openerp>

+ 0 - 0
security/views/stock.xml


BIN
static/description/icon.png