Ir al contenido
Menú
Se marcó esta pregunta
2 Respuestas
8004 Vistas

Hi Community,

I recently believe I may have found a bug in the warehouse system, wondering if anyone can help me confirm.

I recently installed a fresh copy of OpenERP 7 on Ubuntu server, and everything has been working great. However, today, I went into my warehouse settings, and clicked the option to manage multiple warehouses. Now, when I go to warehouses ---> configuration ---> warehouses, when I click on create warehouse I receive the following error popup:

OpenERP Server Error Client Traceback (most recent call last): File "/opt/openerp/v7/web/addons/web/http.py", line 204, in dispatch response["result"] = method(self, *self.params) File "/opt/openerp/v7/web/addons/web/controllers/main.py", line 1128, in call_kw return self._call_kw(req, model, method, args, kwargs) File "/opt/openerp/v7/web/addons/web/controllers/main.py", line 1120, in _call_kw return getattr(req.session.model(model), method)(args, **kwargs) File "/opt/openerp/v7/web/addons/web/session.py", line 42, in proxy result = self.proxy.execute_kw(self.session._db, self.session._uid, self.session._password, self.model, method, args, kw) File "/opt/openerp/v7/web/addons/web/session.py", line 30, in proxy_method result = self.session.send(self.service_name, method, *args) File "/opt/openerp/v7/web/addons/web/session.py", line 103, in send raise xmlrpclib.Fault(openerp.tools.ustr(e), formatted_info)

Server Traceback (most recent call last): File "/opt/openerp/v7/web/addons/web/session.py", line 89, in send return openerp.netsvc.dispatch_rpc(service_name, method, args) File "/opt/openerp/v7/server/openerp/netsvc.py", line 292, in dispatch_rpc result = ExportService.getService(service_name).dispatch(method, params) File "/opt/openerp/v7/server/openerp/service/web_services.py", line 626, in dispatch res = fn(db, uid, params) File "/opt/openerp/v7/server/openerp/osv/osv.py", line 188, in execute_kw return self.execute(db, uid, obj, method, *args, *kw or {}) File "/opt/openerp/v7/server/openerp/osv/osv.py", line 131, in wrapper return f(self, dbname, args, *kwargs) File "/opt/openerp/v7/server/openerp/osv/osv.py", line 197, in execute res = self.execute_cr(cr, uid, obj, method, args, *kw) File "/opt/openerp/v7/server/openerp/osv/osv.py", line 185, in execute_cr return getattr(object, method)(cr, uid, args, *kw) File "/opt/openerp/v7/server/openerp/osv/orm.py", line 1583, in default_get defaults[f] = self._defaultsf File "/opt/openerp/v7/server/openerp/addons/stock/stock.py", line 2963, in _default_lot_output_id return lot_output_id UnboundLocalError: local variable 'lot_output_id' referenced before assignment

I have made no module changes, and this is why this error is so surprising to me. Everything else has been working great. Can anyone else confirm this bug?

Thank you in advance for any help.

Sincerely,

Tim

Avatar
Descartar

When did you install? The build from today is broken - trunk addons is downloaded when you try to download 7.0 addons.

Autor

I updated through bzr today. It looks like my server refuses to download the new version of the warehouse software. Its stuck in an old version it looks like... What should I do?

Whats the difference between trunk addons and 7.0 addons?

You need to wait until OpenERP fixes it. The bzr revisions it SHOULD be letting you download are shown at http//runbot.openerp.com - trunk is the version AFTER version 7.0 (ie: a alpha/beta release of 7.1 or 8.0 or whatever they call the next version).

Autor

Is something like this an urgent issue for the team? My current software is now unusable... Also, is this effecting all modules, or only the warehouse module?

Anything is an urgent issue for customers with an OpenERP Warranty (aka OpenERP Enterprise Pricing). If you have such a warranty or contract, contact OpenERP.

Try again today, there have been two new builds since the one that didn't work.

Mejor respuesta

That is because, buggy code is committed for stock module to get default Output Location:

def _default_lot_output_id(self, cr, uid, context=None):
        try:
            lot_input_stock_model, lot_input_stock_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_output')
            self.pool.get('stock.location').check_access_rule(cr, uid, [lot_input_stock_id], 'read', context=context)
        except (ValueError, orm.except_orm):
            # the user does not have read access on the location or it does not exists
            lot_output_id = False
        return lot_output_id

It should be like this:

def _default_lot_output_id(self, cr, uid, context=None):
        try:
            lot_output_stock_model, lot_output_stock_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_output')
            self.pool.get('stock.location').check_access_rule(cr, uid, [lot_output_stock_id], 'read', context=context)
        except (ValueError, orm.except_orm):
            # the user does not have read access on the location or it does not exists
            lot_output_stock_id = False
        return lot_output_stock_id
Avatar
Descartar

I'm updating this with the bug that Tim filed: https://bugs.launchpad.net/ocb-addons/+bug/1217146. We arrived at the same solution as Dharmesh Patel

Mejor respuesta

Hello Tim,

That's not a bug, it's just that the system can't find the default location data.

As you can see on Addons>Stock>stock_data.xml

There are two records that are going to be inserted on the db:

<record id="stock_location_output" model="stock.location">
        <field name="name">Output</field>
        <field name="location_id" ref="stock_location_company"/>
        <field name="usage">internal</field>
        <field name="chained_location_type">customer</field>
        <field name="chained_auto_packing">transparent</field>
        <field name="chained_picking_type">out</field>
        <field name="chained_journal_id" ref="journal_delivery"/>
    </record>
    <record id="stock_location_stock" model="stock.location">
        <field name="name">Stock</field>
        <field name="location_id" ref="stock_location_company"/>
    </record>

And the error that is showing up to you it's because this function can't find it.

def _default_lot_input_stock_id(self, cr, uid, context=None):
    lot_input_stock = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_stock')
    return lot_input_stock.id

def _default_lot_output_id(self, cr, uid, context=None):
    lot_output = self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'stock_location_output')
    return lot_output.id

_defaults = {
    'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c),
    'lot_input_id': _default_lot_input_stock_id,
    'lot_stock_id': _default_lot_input_stock_id,
    'lot_output_id': _default_lot_output_id,
}

So my advice is: go to Configuration>Installed Modules and look for stock module... Update it and it's going to work. If that doesn't work maybe there is a problem with stock module and you have to download it again.

Avatar
Descartar
Autor

Thank you for the advice. However, as noted in a comment above by Ray Carnes, this is an issue with openERP. For anyone else looking at the post, the issue is not fixed by the above answer.

Publicaciones relacionadas Respuestas Vistas Actividad
2
mar 15
6768
1
mar 24
1170
0
nov 16
5188
0
mar 15
4043
0
ene 25
970