如何确定MRP序列号 [英] How to fix MRP sequence number

查看:102
本文介绍了如何确定MRP序列号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在OpenERP上的MRP标准模块有问题. 问题出在所有制造订单的序列号上.

I am having a problem with MRP standard module on OpenERP. The problem is on the sequence number of all manufactoring orders.

如果我单击创建"按钮,然后单击放弃"按钮,则制造订单号将依次增加.之所以发生这种情况,是因为获得号码的操作是在创建"按钮上而不是在保存"按钮上.因此,如果我单击创建/放弃" 10次,即使没有一个被保存,这个数字也会增加10倍.

If I click on Create button and then Discard button, the manufactory order number increases in sequence. This is happening because the action of achiving the number is on the Create button and not on Save button. So, if I click Create/Discard 10 times, this number will increase 10 times even thinking that none of them were saved.

我需要做的是在保存"按钮上添加一个操作,以在数据库上验证最后保存的数字是什么(独立于其状态),然后将下一个数字添加到当时我要保存的制造顺序中.这样,我将保证制造订单编号顺序是正确的.

What I need to do is do add an action on the Save button, to verify on the database what was the last saved number (independently of its state) and add the next number to the manufactoring order I am saving at that moment. This way I will garantee that the manufactoring order number sequence is correct.

提前谢谢大家

Paulo

推荐答案

您需要在核心模块文件中进行以下更改.

You need to change few following changes in your file of core module.

  • addons/mrp/mrp.py

在上面的文件中,首先找到class mrp_production_columns = {,并且字段为name remove required = True and readonly = Ture ,然后找到_defaults =并在name上进行注释.

In above file first find class mrp_production and _columns = { and field is name remove required=True and readonly=Ture and than find _defaults = and than comment on name.

先写在create method.

def create(self, cr, uid, vals, context=None):
    vals['name'] = self.pool.get('ir.sequence').get(cr, uid, 'mrp.production')
    return super(mrp_production, self).create(cr, uid, vals, context=context)

  • addons/mrp/mrp_view.xml
  • 在此文件中找到<h1>Manufacturing Order <field name="name" class="oe_inline"/></h1>并替换为此

    In this file find <h1>Manufacturing Order <field name="name" class="oe_inline"/></h1> and replace with this

    <h1>Manufacturing Order <field name="name" class="oe_inline" readonly="1"/></h1>
    

    然后使用升级数据库和模块名称mrp重新启动服务器.

    After than restart your server with upgrade database and module name mrp.

    希望这可以解决您的问题.

    Hope this will solve your problem.

    这篇关于如何确定MRP序列号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆