Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

What does this error mean trying to import my own stock_custom module?

By
Pascal Tremblay
on 4/4/15, 7:18 PM 1,001 views

Hello guys,

After many days trying to build my own stock_custom module, I get this error. Somebody would have a tip for me?

Thanks


2015-04-04 23:01:15,233 32751 ERROR 03test werkzeug: Error on request:

Traceback (most recent call last):

File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 159, in run_wsgi

execute(app)

File "/usr/local/lib/python2.7/dist-packages/werkzeug/serving.py", line 146, in execute

application_iter = app(environ, start_response)

File "/home/odoo-test/odoo-test/openerp/service/server.py", line 281, in app

return self.app(e, s)

File "/home/odoo-test/odoo-test/openerp/service/wsgi_server.py", line 216, in application

return application_unproxied(environ, start_response)

File "/home/odoo-test/odoo-test/openerp/service/wsgi_server.py", line 202, in application_unproxied

result = handler(environ, start_response)

File "/home/odoo-test/odoo-test/openerp/http.py", line 1275, in __call__

return self.dispatch(environ, start_response)

File "/home/odoo-test/odoo-test/openerp/http.py", line 1249, in __call__

return self.app(environ, start_wrapped)

File "/usr/local/lib/python2.7/dist-packages/werkzeug/wsgi.py", line 411, in __call__

return self.app(environ, start_response)

File "/home/odoo-test/odoo-test/openerp/http.py", line 1407, in dispatch

ir_http = request.registry['ir.http']

File "/home/odoo-test/odoo-test/openerp/http.py", line 338, in registry

return openerp.modules.registry.RegistryManager.get(self.db) if self.db else None

File "/home/odoo-test/odoo-test/openerp/modules/registry.py", line 315, in get

update_module)

File "/home/odoo-test/odoo-test/openerp/modules/registry.py", line 346, in new

openerp.modules.load_modules(registry._db, force_demo, status, update_module)

File "/home/odoo-test/odoo-test/openerp/modules/loading.py", line 359, in load_modules

force, status, report, loaded_modules, update_module)

File "/home/odoo-test/odoo-test/openerp/modules/loading.py", line 263, in load_marked_modules

loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks)

File "/home/odoo-test/odoo-test/openerp/modules/loading.py", line 182, in load_module_graph

_load_data(cr, module_name, idref, mode, kind='data')

File "/home/odoo-test/odoo-test/openerp/modules/loading.py", line 118, in _load_data

tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report)

File "/home/odoo-test/odoo-test/openerp/tools/convert.py", line 901, in convert_file

convert_xml_import(cr, module, fp, idref, mode, noupdate, report)

File "/home/odoo-test/odoo-test/openerp/tools/convert.py", line 987, in convert_xml_import

obj.parse(doc.getroot(), mode=mode)

File "/home/odoo-test/odoo-test/openerp/tools/convert.py", line 853, in parse

self._tags[rec.tag](self.cr, rec, n, mode=mode)

File "/home/odoo-test/odoo-test/openerp/tools/convert.py", line 763, in _tag_record

id = self.pool['ir.model.data']._update(cr, self.uid, rec_model, self.module, res, rec_id or False, not self.isnoupdate(data_node), noupdate=self.isnoupdate(data_node), mode=self.mode, context=rec_context )

File "/home/odoo-test/odoo-test/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/odoo-test/odoo-test/openerp/addons/base/ir/ir_model.py", line 1040, in _update

model_obj.write(cr, uid, [res_id], values, context=context)

File "/home/odoo-test/odoo-test/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/odoo-test/odoo-test/addons/purchase/stock.py", line 231, in write

return super(stock_warehouse, self).write(cr, uid, ids, vals, context=None)

File "/home/odoo-test/odoo-test/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/odoo-test/odoo-test/addons/mrp/stock.py", line 296, in write

return super(stock_warehouse, self).write(cr, uid, ids, vals, context=None)

File "/home/odoo-test/odoo-test/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/odoo-test/odoo-test/addons/stock/stock.py", line 3488, in write

seq_obj.write(cr, uid, warehouse.out_type_id.sequence_id.id, {'name': name + _(' Sequence out'), 'prefix': vals.get('code', warehouse.code) + '\OUT\\'}, context=context)

File "/home/odoo-test/odoo-test/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/odoo-test/odoo-test/openerp/addons/base/ir/ir_sequence.py", line 190, in write

rows = self.read(cr, uid, ids, ['implementation', 'number_increment', 'number_next'], context)

File "/home/odoo-test/odoo-test/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/odoo-test/odoo-test/openerp/models.py", line 3091, in read

result = BaseModel.read(records, fields, load=load)

File "/home/odoo-test/odoo-test/openerp/api.py", line 239, in wrapper

return new_api(self, *args, **kwargs)

File "/home/odoo-test/odoo-test/openerp/models.py", line 3123, in read

self._read_from_database(stored)

File "/home/odoo-test/odoo-test/openerp/api.py", line 239, in wrapper

return new_api(self, *args, **kwargs)

File "/home/odoo-test/odoo-test/openerp/models.py", line 3321, in _read_from_database

forbidden = missing.exists()

File "/home/odoo-test/odoo-test/openerp/api.py", line 239, in wrapper

return new_api(self, *args, **kwargs)

File "/home/odoo-test/odoo-test/openerp/models.py", line 4791, in exists

self._cr.execute(query, [tuple(ids)])

File "/home/odoo-test/odoo-test/openerp/sql_db.py", line 158, in wrapper

return f(self, *args, **kwargs)

File "/home/odoo-test/odoo-test/openerp/sql_db.py", line 234, in execute

res = self._obj.execute(query, params)

ParseError: "operator does not exist: integer = boolean

LINE 1: SELECT id FROM "ir_sequence" WHERE id IN (false)

^

HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.

" while parsing /home/odoo-test/odoo-test/addons/stock_lapagept/lapagept_warehouses.xml:6, near

<record id="stock_lapagept.warehouse_as" model="stock.warehouse">

<field name="partner_id" ref="partners_lapagept.partner_as"/>

<field name="company_id" ref="partners_lapagept.company_as"/>

<field name="name">Créations Au fil du tempS - PT warehousesdf - 2</field>

<field name="code">WHASs</field>

</record>

1

Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--
4136
| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
On 4/5/15, 7:40 AM

Hi,

error comes from :


File "/home/odoo-test/odoo-test/addons/stock/stock.py", line 3488, in write

seq_obj.write(cr, uid, warehouse.out_type_id.sequence_id.id, {'name': name + _(' Sequence out'), 'prefix': vals.get('code', warehouse.code) + '\OUT\\'}, context=context)

more, this:

warehouse.out_type_id.sequence_id.id

you have out_type_id which has no sequence_id defines for object stock.picking.type :

_description = "The picking type determines the picking view"


in class stock warehouse, 2 fields are required an not in your xml:

view_location_id and lot_stock_id

but values for this 2 fields are created in overrided function create of stock warehouse class:

#create view location for warehouse

loc_vals = {

'name': _(vals.get('code')),

'usage': 'view',

'location_id': data_obj.get_object_reference(cr, uid, 'stock', 'stock_location_locations')[1],

}

if vals.get('company_id'):

loc_vals['company_id'] = vals.get('company_id')

wh_loc_id = location_obj.create(cr, uid, loc_vals, context=context)

vals['view_location_id'] = wh_loc_id


after this a function is called to create stock picking type (in, out, pack ...):

self.create_sequences_and_picking_types(cr, uid, warehouse, context=context)


in this method,  sequence_id are created for in, out ...

out_seq_id = seq_obj.create(cr, SUPERUSER_ID, values={'name': warehouse.name + _(' Sequence out'), 'prefix': warehouse.code + '/OUT/', 'padding': 5}, context=context)


and later stock picking type with its sequence_id :


out_type_id = picking_type_obj.create(cr, uid, vals={

'name': _('Delivery Orders'),

'warehouse_id': warehouse.id,

'code': 'outgoing',

'sequence_id': out_seq_id,

'return_picking_type_id': in_type_id,

'default_location_src_id': output_loc.id,

'default_location_dest_id': customer_loc.id,

'sequence': max_sequence + 4,

'color': color}, context=context)


and all picking type are add to warehouse :


#write picking types on WH

vals = {

'in_type_id': in_type_id,

'out_type_id': out_type_id,

'pack_type_id': pack_type_id,

'pick_type_id': pick_type_id,

'int_type_id': int_type_id,

}

super(stock_warehouse, self).write(cr, uid, warehouse.id, vals=vals, context=context)


my conclusion :

all is well done in creation process.

I think the problem is the name of your warehouse :

Créations Au fil du tempS - PT warehousesdf - 2

perhaps special character "é" is the problem or lenght of the name (because sequence id add to the warehouse name a string)


try with a name without special character and with lower string, by example:

Warehouse test (you could change it later, if this solves your error)


bye

You are very nice. Thanks a lot!

Pascal Tremblay
on 4/5/15, 8:33 AM

f this solves your problem, you could validate my answer, bye

Cyril Gaspard (GEM)
on 4/5/15, 9:45 AM

When I go in warehouse->Configuration->Warehouses, I get the same error when I edit a warehouse an I try to rename it. But only for name and code fields. If try to modify an other field in the warehouse edit form, I can save without problem.

Pascal Tremblay
on 5/18/15, 7:39 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/4/15, 7:18 PM
Seen: 1001 times
Last updated: 4/5/15, 7:41 AM