Parcourir la source

Modulo product_stockminimo_treecolor

sebas il y a 8 ans
commit
e7be3b4c00

+ 2 - 0
__init__.py

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

BIN
__init__.pyc


+ 33 - 0
__openerp__.py

@@ -0,0 +1,33 @@
+# -*- coding: utf-8 -*-
+{
+    'name': "Product Tree Color",
+
+    'summary': """
+
+Actualizacion del producto en color de tree Basado en la cantidad disponible y en la cantidad minima de entrada del usuario""",
+
+    'description': """
+
+Este modulo hace que la fila del producto en la vista tree se vuelva roja cuando la cantidad alcanzo la cantidad minima que la entrada del usuario
+    """,
+
+
+    'author': "Eiru/Sebastian Penayo",
+    'website': "www.eiru.com.py",
+
+    # Categories can be used to filter modules in modules listing
+    # for the full list
+    'category': 'warehouse',
+    'version': '8.0.1.0.0',
+
+    # any module necessary for this one to work correctly
+    'depends': ['base','stock','product'],
+
+    # always loaded
+    'data': [
+        # 'sale_inherit_workflow.xml',
+        'views/templates.xml',
+    ],
+    # only loaded in demonstration mode
+
+}

+ 3 - 0
models/__init__.py

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

BIN
models/__init__.pyc


+ 7 - 0
models/models.py

@@ -0,0 +1,7 @@
+
+# -*- coding: utf-8 -*-
+from openerp import models,fields
+
+class ProductProduct(models.Model):
+    _inherit = 'product.template'
+    minimo_quantity = fields.Integer(string="Stock Minimo", required=False, )

BIN
models/models.pyc


BIN
static/description/icon.png


BIN
static/description/product_form.PNG


BIN
static/description/product_tree.PNG


+ 34 - 0
views/templates.xml

@@ -0,0 +1,34 @@
+<openerp>
+    <data>
+        <!-- Inherit Form View to Modify it -->
+        <record id="product_minimo_form_inherit" model="ir.ui.view">
+            <field name="name">product minimo form</field>
+            <field name="model">product.template</field>
+            <field name="inherit_id" ref="product.product_template_form_view"/>
+            <field name="arch" type="xml">
+                <field name="list_price" position="after">
+                    <field name="minimo_quantity"
+                           help="Este campo le permite ser alertado en la vista tree cuando la cantidad que tiene en stock es menor que este numero la columna de producto en vista tree estara en color rojo."/>
+                </field>
+            </field>
+        </record>
+        <record id="product_minimo_inherit_tree" model="ir.ui.view">
+            <field name="name">product minimo tree</field>
+            <field name="model">product.template</field>
+            <field name="inherit_id" ref="product.product_template_tree_view"/>
+            <field name="arch" type="xml">
+                <tree position="attributes">
+                    <attribute name="colors" translation="off">red:qty_available&lt;=minimo_quantity;blue:virtual_available&gt;=0
+                        and state in ('draft', 'end', 'obsolete');black:virtual_available&gt;=0 and state not in
+                        ('draft', 'end', 'obsolete')
+                    </attribute>
+                </tree>
+                <field name="uom_id" position="before">
+                    <field name="minimo_quantity"/>
+                </field>
+            </field>
+        </record>
+
+
+    </data>
+</openerp>