Просмотр исходного кода

Modulo para agregar en línea de stock referencia de fabrica

sebas 4 лет назад
Сommit
872fec6edd
8 измененных файлов с 100 добавлено и 0 удалено
  1. 1 0
      __init__.py
  2. BIN
      __init__.pyc
  3. 13 0
      __openerp__.py
  4. 14 0
      factory_ref_stock.py
  5. BIN
      factory_ref_stock.pyc
  6. 45 0
      factory_ref_stock_info.xml
  7. 27 0
      factory_ref_stock_view.xml
  8. BIN
      static/description/icon.png

+ 1 - 0
__init__.py

@@ -0,0 +1 @@
+from . import factory_ref_stock


+ 13 - 0
__openerp__.py

@@ -0,0 +1,13 @@
+{
+    'name':'Factory reference in Stock',
+    'description':"""
+Factory Reference in Stock
+=============================
+Factory
+""",
+    'author': 'Eiru Software/Alejandro Kennedy',
+    'website':'www.paraguayenlaweb.com',
+    'depends':['base','stock'],
+    'data':['factory_ref_stock_view.xml', 'factory_ref_stock_info.xml'],
+    'installable':True,
+}

+ 14 - 0
factory_ref_stock.py

@@ -0,0 +1,14 @@
+from openerp import models, fields, api
+
+class factory_ref_stock(models.Model):
+    _inherit = 'stock.move'
+    _name = 'stock.move'
+
+    @api.one
+    @api.depends('product_id')
+    def get_factory_ref(self):
+        self.factory_ref = self.product_id.factory_reference
+
+    factory_ref = fields.Char(string="Factory Reference", compute="get_factory_ref")
+
+

BIN
factory_ref_stock.pyc


+ 45 - 0
factory_ref_stock_info.xml

@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <report id="factory_reference_stock_listado"
+                model="stock.picking"
+                string="Listados de Transferencias"
+                report_type="qweb-pdf"
+                name="factory_reference_stock.report_listado_albaran_ref"
+                file="factory_reference_stock.report_listado_albaran_ref"/>
+
+        <template id="report_listado_albaran_ref">
+            <t t-call="report.html_container">
+                <t t-call="report.external_layout">
+                    <div class="page">
+                        <h2>Listado de transferencia de productos</h2>
+                        <table class = "table table-condensed">
+                            <thead>
+                                <th>Fecha</th>
+                                <th>Producto</th>
+                                <th>Referencia</th>
+                                <th>Cantidad</th>
+                                <th>Origen</th>
+                                <th>Destino</th>
+                                <th>Estado</th>
+                            </thead>
+                            <t t-foreach="docs" t-as="o">
+                                <t t-foreach="o.move_lines" t-as="move">
+                                    <tbody>
+                                        <td><span t-field="move.date"/></td>
+                                        <td><span t-field="move.product_id"/></td>
+                                        <td><span t-field="move.factory_ref"/></td>
+                                        <td><span t-field="move.product_qty"/></td>
+                                        <td><span t-field="move.location_id"/></td>
+                                        <td><span t-field="move.location_dest_id"/></td>
+                                        <td><span t-field="move.state"/></td>
+                                    </tbody>
+                                </t>
+                            </t>
+                        </table>
+                    </div>
+                </t>
+            </t>
+        </template>
+   </data>
+</openerp>

+ 27 - 0
factory_ref_stock_view.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<openerp>
+    <data>
+        <record model="ir.ui.view" id="stock_move_factory_form">
+           <field name="name">stock.move.factory_form</field>
+           <field name="model">stock.move</field>
+           <field name="inherit_id" ref="stock.view_move_picking_form"/>
+           <field name="arch" type="xml">
+               <field name="product_id" position="after">
+                   <field name="factory_ref"/>
+               </field>
+           </field>
+        </record>
+
+        <record model="ir.ui.view" id="st_move_factory_ref">
+           <field name="name">st.move.factory.ref</field>
+           <field name="model">stock.move</field>
+           <field name="inherit_id" ref="stock.view_move_picking_tree"/>
+           <field name="arch" type="xml">
+               <xpath expr="//field['product_id']" position="after">
+                    <field name="factory_ref"/>
+               </xpath>
+           </field>
+       </record>
+
+   </data>
+</openerp>

BIN
static/description/icon.png