Browse Source

Agregar ubicación extra en producción

sebas 3 years ago
commit
938994280e

+ 3 - 0
__init__.py

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

BIN
__init__.pyc


+ 35 - 0
__openerp__.py

@@ -0,0 +1,35 @@
+# -*- coding: utf-8 -*-
+# 'views/mrp_production.xml',
+
+{
+    'name': 'Extra ubicación en Producción',
+    'version': '2.0',
+    'author' : 'Eiru Software, Sebastian Penayo',
+    'website': 'www.eiru.com.py',
+    'description': """
+
+Funcionalidad:
+ - Añade un campo en mrp.produccion, mrp_ubicacion_id que es la ubicación extra donde se coloco inicialmente los productos producidos.
+
+
+    """,
+
+    'category': 'Manufacturing',
+    'depends': [
+        'mrp',
+        'stock',
+        'product'
+
+    ],
+
+    'data': [
+        'views/mrp_extra_ubicacion_data.xml',
+        'views/mrp_extra_ubicacion_view.xml',
+        'views/mrp_production.xml'
+    ],
+
+    'installable': True,
+}
+
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

+ 3 - 0
models/__init__.py

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

BIN
models/__init__.pyc


+ 33 - 0
models/mrp_extra_ubicacion.py

@@ -0,0 +1,33 @@
+# -*- 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 MrpExtraUbicacion(models.Model):
+    _name = 'mrp.extra.ubicacion'
+
+    name = fields.Char('Extra Ubicacion')
+
+
+class MrpProduction(models.Model):
+    _inherit = 'mrp.production'
+
+    mrp_ubicacion_id = fields.Many2one(
+        'mrp.extra.ubicacion',
+        string='Ubicación Extra',
+        help='Seleccione la ubicación extra del producto terminado'
+    )

BIN
models/mrp_extra_ubicacion.pyc


+ 8 - 0
models/mrp_production.py

@@ -0,0 +1,8 @@
+# -*- encoding: utf-8 -*-
+
+from openerp import models, api, fields
+
+class MrpProduction(models.Model):
+    _inherit = 'mrp.production'
+
+    mrp_ubicacion_id = fields.many2one('mrp.extra.ubicacion',string='Ubicación Extra', help='Seleccione la ubicación extra del producto terminado')

BIN
models/mrp_production.pyc


BIN
static/description/icon.png


+ 19 - 0
views/mrp_extra_ubicacion_data.xml

@@ -0,0 +1,19 @@
+<openerp>
+    <data>
+        <record model="mrp.extra.ubicacion" id="1">
+            <field name="name">Taller</field>
+        </record>
+        <record model="mrp.extra.ubicacion" id="2">
+            <field name="name">Impresiones</field>
+        </record>
+       <record model="mrp.extra.ubicacion" id="3">
+            <field name="name">Salón</field>
+        </record>
+        <record model="mrp.extra.ubicacion" id="4">
+            <field name="name">Recepción</field>
+        </record>
+        <record model="mrp.extra.ubicacion" id="5">
+            <field name="name">Otra</field>
+        </record>
+    </data>
+</openerp>

+ 50 - 0
views/mrp_extra_ubicacion_view.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record id="mrp_extra_ubicacion_search_form_view" model="ir.ui.view">
+            <field name="name">mrp.extra.ubicacion.search.form</field>
+            <field name="model">mrp.extra.ubicacion</field>
+            <field name="arch" type="xml">
+                <search string="Ubicación">
+                   <field name="name"/>
+                </search>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="view_mrp_extra_ubicacion_form">
+            <field name="name">mrp.extra.ubicacion.form</field>
+            <field name="model">mrp.extra.ubicacion</field>
+            <field name="arch" type="xml">
+                <form string="Ubicación">
+                  <group>
+                      <field name="name"/>
+                  </group>
+                </form>
+            </field>
+        </record>
+
+        <record model="ir.ui.view" id="view_mrp_extra_ubicacion_tree">
+            <field name="name">mrp.extra.ubicacion</field>
+            <field name="model">mrp.extra.ubicacion</field>
+            <field name="arch" type="xml">
+                <tree string="Ubicación">
+                    <field name="name"/>
+                </tree>
+            </field>
+        </record>
+
+
+        <record model="ir.actions.act_window" id="action_mrp_ubicacion">
+            <field name="name">Ubicacion</field>
+            <field name="res_model">mrp.extra.ubicacion</field>
+            <field name="view_type">form</field>
+            <field name="view_mode">tree,form</field>
+        </record>
+
+        <menuitem id="mrp_extra_ubicacion_menu" name="Ubicación" parent="base.menu_mrp_root" sequence="150"/>
+
+        <!-- sub menu -->
+        <menuitem id="menu_mrp_extra_ubicacion" parent="mrp_extra_ubicacion_menu" name="Crear Ubicación" action="action_mrp_ubicacion" sequence="2"/>
+
+    </data>
+</openerp>

+ 43 - 0
views/mrp_production.xml

@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+<data>
+
+    <record id="mrp_production_ubicacion_form_view" model="ir.ui.view">
+        <field name="name">MRP con Ubicación Extra</field>
+        <field name="model">mrp.production</field>
+        <field name="inherit_id" ref="mrp.mrp_production_form_view" />
+        <field name="arch" type="xml">
+            <field name="date_planned" position="after">
+                <field name="mrp_ubicacion_id" string="Ubicación Extra"/>
+            </field>
+        </field>
+    </record>
+
+    <record id="mrp_production_ubicacion_tree_view" model="ir.ui.view">
+        <field name="name">MRP con Ubicación Extra</field>
+        <field name="model">mrp.production</field>
+        <field name="inherit_id" ref="mrp.mrp_production_tree_view"/>
+        <field name="arch" type="xml">
+            <field name="date_planned" position="after">
+                <field name="mrp_ubicacion_id" string="Ubicación Extra"/>
+            </field>
+        </field>
+    </record>
+
+    <record id="mrp_production_ubicacion_info_search_view" model="ir.ui.view">
+        <field name="name">MRP Production con Ubicación Extra</field>
+        <field name="model">mrp.production</field>
+        <field name="inherit_id" ref="mrp.view_mrp_production_filter" />
+        <field name="arch" type="xml">
+            <field name="product_id" position="after">
+                <field name="mrp_ubicacion_id" />
+            </field>
+            <group position="inside">
+                <filter string="Ubicación Extra" icon="terp-accessories-archiver"
+                    domain="[]" context="{'group_by':'mrp_ubicacion_id'}" />
+            </group>
+        </field>
+    </record>
+
+</data>
+</openerp>