浏览代码

MRP Edición de componentes

sebas 3 年之前
当前提交
118d9995ef
共有 9 个文件被更改,包括 90 次插入0 次删除
  1. 3 0
      __init__.py
  2. 二进制
      __init__.pyc
  3. 34 0
      __openerp__.py
  4. 3 0
      models/__init__.py
  5. 二进制
      models/__init__.pyc
  6. 23 0
      models/mrp_production.py
  7. 二进制
      models/mrp_production.pyc
  8. 二进制
      static/description/icon.png
  9. 27 0
      views/mrp_view.xml

+ 3 - 0
__init__.py

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

二进制
__init__.pyc


+ 34 - 0
__openerp__.py

@@ -0,0 +1,34 @@
+# -*- coding: utf-8 -*-
+
+{
+    'name': 'MRP Edición de componentes',
+    'version': '1.0',
+    'author' : 'Eiru Software, Sebastian Penayo',
+    'website': 'www.eiru.py',
+    'description': """
+
+Funcionalidad:
+ - Edición de componentes consumibles.
+
+
+    """,
+
+    'category': 'Manufacturing',
+    'depends': [
+        'mrp',
+        'mrp_bom_total_price',
+        'stock',
+        'sale',
+        'product'
+
+    ],
+
+    'data': [
+        'views/mrp_view.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_production

二进制
models/__init__.pyc


+ 23 - 0
models/mrp_production.py

@@ -0,0 +1,23 @@
+ # -*- coding: utf-8 -*-
+
+# import openerp.addons.decimal_precision as dp
+
+from openerp.exceptions import except_orm, Warning, RedirectWarning
+from openerp import models, fields, api, _
+from openerp.tools.translate import _
+from openerp import SUPERUSER_ID, api
+import openerp.addons.decimal_precision as dp
+
+class mrp_production(models.Model):
+    _inherit = 'mrp.production'
+
+    move_lines = fields.One2many( readonly=False, states={'done': [('readonly', True)]}  )
+
+    @api.multi
+    def write(self,  vals ):
+        res = super(mrp_production, self).write(  vals )
+        for move in self.move_lines:
+            if move.state == 'draft':
+                # se de facut o copie a miscarii si trecuta miscarea la la productie la productie
+                move.action_confirm()
+        return res

二进制
models/mrp_production.pyc


二进制
static/description/icon.png


+ 27 - 0
views/mrp_view.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0"?>
+<openerp>
+    <data>
+        <record id="mrp_production_form_view" model="ir.ui.view">
+            <field name="name">eirusoft.mrp.production.form</field>
+            <field name="model">mrp.production</field>
+            <field name="type">form</field>
+            <field name="inherit_id" ref="mrp.mrp_production_form_view"/>
+            <field name="arch" type="xml">
+      				<xpath expr="//group[@string='Products to Consume']/field" position="attributes">
+      					<attribute name="context">{'default_location_id':location_src_id, 'default_location_dest_id': %(stock.location_production)d, 'default_name':'Unplanned consumption' }</attribute>
+      				</xpath>
+      				<xpath expr="//group[@string='Products to Consume']/field/tree" position="attributes">
+      					<attribute name="editable">bottom</attribute>
+      				</xpath>
+      				<xpath expr="//group[@string='Products to Consume']/field/tree/field[@name='state']" position="after">
+      					<field name="name" invisible="1"/>
+      					<field name="location_id" invisible="1"/>
+      					<field name="location_dest_id" invisible="1"/>
+      				</xpath>
+      				<xpath expr="//group[@string='Products to Consume']/field/tree/field[@name='product_id']" position="replace">
+      					<field name="product_id" on_change="onchange_product_id(product_id,location_id,location_dest_id)" />
+      				</xpath>
+      			</field>
+      		</record>
+    </data>
+</openerp>