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

ImportError: No module named product

By
Luke Branch
on 6/27/14, 5:25 AM 4,314 views

Hi,
I've tried to install the custom module (compatible with Openerp 7) in an instance of Odoo v8 using the instructions in the following forum post:

https://www.odoo.com/forum/Help-1/question/OpenERP-7-How-can-I-add-images-in-saleoderline-or-in-treeview-generally-483

however when I try to install i'm getting a traceback that includes the following line:

ImportError: No module named product

I am just starting to work with Odoo/OpenERP so forgive me if the answer to my question is obvious. From my understanding it is trying to import a python module called 'product' which is not installed in the system, however i'm not sure which module I should install and whether I can find it in apt or pip.

I am wondering if there has been any structural/name changes to Odoo v8 that would cause simple v7 modules such as this to not be able to install. Is this something that could be triggered by simple name changes (in the code) or structural changes that might be able to be ported to v8?

If anyone has a link to where I could find information on porting a module from v7 to v8 in developer documentation for example please post and let me know as I would like to port this module to v8 and post the code back on the original thread so that those who want to can use this useful module in v8 as well.


The full traceback for this is as follows:

Traceback (most recent call last): File "/opt/odoo/openerp/http.py", line 470, in dispatch result = self._call_function(**self.params) File "/opt/odoo/openerp/http.py", line 294, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo/openerp/service/model.py", line 113, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo/openerp/http.py", line 291, in checked_call return self.endpoint(*a, **kw) File "/opt/odoo/openerp/http.py", line 652, in __call__ return self.method(*args, **kw) File "/opt/odoo/openerp/http.py", line 337, in response_wrap response = f(*args, **kw) File "/opt/odoo/addons/web/controllers/main.py", line 1050, in call_button action = self._call_kw(model, method, args, {}) File "/opt/odoo/addons/web/controllers/main.py", line 1038, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/opt/odoo/openerp/addons/base/module/module.py", line 437, in button_immediate_install return self._button_immediate_function(cr, uid, ids, self.button_install, context=context) File "/opt/odoo/openerp/addons/base/module/module.py", line 488, in _button_immediate_function registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True) File "/opt/odoo/openerp/modules/registry.py", line 299, in new openerp.modules.load_modules(registry._db, force_demo, status, update_module) File "/opt/odoo/openerp/modules/loading.py", line 343, in load_modules loaded_modules, update_module) File "/opt/odoo/openerp/modules/loading.py", line 247, in load_marked_modules loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks) File "/opt/odoo/openerp/modules/loading.py", line 149, in load_module_graph load_openerp_module(package.name) File "/opt/odoo/openerp/modules/module.py", line 266, in load_openerp_module __import__('openerp.addons.' + module_name) File "/opt/odoo/openerp/modules/module.py", line 72, in load_module mod = imp.load_module('openerp.addons.' + module_part, f, path, descr) File "/opt/odoo/addons/product_image/__init__.py", line 1, in <module> import product ImportError: No module named product

Please check, did you the product module?

Remya
on 6/28/14, 12:44 AM

Hi Remya, Thanks for the reply. The product module is installed and has the same name as in OpenERP 7 and references in other modules use import product without any issues. Are you aware of any changes to the architecture between v7 and v8 that might be causing this issue?

Luke Branch
on 6/29/14, 1:36 AM

Hi Remya, Further to the above traceback I have been working through each error message as it presented itself and I seem to have made some progress. I am using the latest pull from the master branch (Odoo v8 alpha) on Ubuntu 14.04 clean install. My steps are as follows: 1) create a new directory in /odoo/addons/ called /product_image_SO/ 2) copy the contents of the /odoo/addons/product/ directory into /odoo/addons/product_image_SO/ 3) overwrite the following files with the one's suggested by Stefan (https://www.odoo.com/forum/Help-1/question/OpenERP-7-How-can-I-add-images-in-saleoderline-or-in-treeview-generally-483): __init__.py __openerp__.py product_view.xml sale_view.xml stock_view.xml stock.py view_list.js 4) Update modules list from Settings menu 5) Install product_image_SO this has allowed me to progress past error messages such as 'no module named product' so I am assuming this is at least a step in the right direction, however I am stuck on the following error/traceback message: Error details: Field `virtual_available` does not exist Error context: View `product.product.tree` [view_id: 2124, xml_id: n/a, model: product.product, parent_id: 256]" while parsing /opt/odoo/odoo-server/addons/product_image_SO/product_view.xml:5, near product.product.treeproduct.product The full traceback is as follows: OpenERP Server Error Traceback (most recent call last): File "/opt/odoo/odoo-server/openerp/http.py", line 462, in _handle_exception return super(JsonRequest, self)._handle_exception(exception) File "/opt/odoo/odoo-server/openerp/http.py", line 481, in dispatch result = self._call_function(**self.params) File "/opt/odoo/odoo-server/openerp/http.py", line 297, in _call_function return checked_call(self.db, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/service/model.py", line 113, in wrapper return f(dbname, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/http.py", line 294, in checked_call return self.endpoint(*a, **kw) File "/opt/odoo/odoo-server/openerp/http.py", line 671, in __call__ return self.method(*args, **kw) File "/opt/odoo/odoo-server/openerp/http.py", line 346, in response_wrap response = f(*args, **kw) File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 990, in call_button action = self._call_kw(model, method, args, {}) File "/opt/odoo/odoo-server/addons/web/controllers/main.py", line 978, in _call_kw return getattr(request.registry.get(model), method)(request.cr, request.uid, *args, **kwargs) File "/opt/odoo/odoo-server/openerp/addons/base/module/module.py", line 437, in button_immediate_install return self._button_immediate_function(cr, uid, ids, self.button_install, context=context) File "/opt/odoo/odoo-server/openerp/addons/base/module/module.py", line 484, in _button_immediate_function registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True) File "/opt/odoo/odoo-server/openerp/modules/registry.py", line 299, in new openerp.modules.load_modules(registry._db, force_demo, status, update_module) File "/opt/odoo/odoo-server/openerp/modules/loading.py", line 363, in load_modules loaded_modules, update_module) File "/opt/odoo/odoo-server/openerp/modules/loading.py", line 267, in load_marked_modules loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks) File "/opt/odoo/odoo-server/openerp/modules/loading.py", line 186, in load_module_graph _load_data(cr, module_name, idref, mode, kind='data') File "/opt/odoo/odoo-server/openerp/modules/loading.py", line 118, in _load_data tools.convert_file(cr, module_name, filename, idref, mode, noupdate, kind, report) File "/opt/odoo/odoo-server/openerp/tools/convert.py", line 984, in convert_file convert_xml_import(cr, module, fp, idref, mode, noupdate, report) File "/opt/odoo/odoo-server/openerp/tools/convert.py", line 1070, in convert_xml_import obj.parse(doc.getroot()) File "/opt/odoo/odoo-server/openerp/tools/convert.py", line 937, in parse self._tags[rec.tag](self.cr, rec, n) File "/opt/odoo/odoo-server/openerp/tools/convert.py", line 855, 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 "/opt/odoo/odoo-server/openerp/addons/base/ir/ir_model.py", line 1014, in _update res_id = model_obj.create(cr, uid, values, context=context) File "/opt/odoo/odoo-server/openerp/addons/base/ir/ir_ui_view.py", line 270, in create context=context) File "/opt/odoo/odoo-server/openerp/osv/orm.py", line 4254, in create self._validate(cr, user, [id_new], context) File "/opt/odoo/odoo-server/openerp/osv/orm.py", line 1576, in _validate raise except_orm('ValidateError', '\n'.join(error_msgs)) ParseError: "ValidateError The field(s) `arch` failed against a constraint: Invalid view definition Error details: Field `virtual_available` does not exist Error context: View `product.product.tree` [view_id: 2124, xml_id: n/a, model: product.product, parent_id: 256]" while parsing /opt/odoo/odoo-server/addons/product_image_SO/product_view.xml:5, near product.product.treeproduct.product Do you have any insight as to what this error message means? I am just learning the basics of Odoo so my apologies if there is anything obvious that I have missed. I am assuming that this has something to do with the way the XML is formatted that is perhaps not in the correct syntax, however if you have any insight on this I would very much appreciate your input. From what I understand there have obviously been some restructuring to the architecture of Odoo v8 from Odoo/OpenERP v7 (that this module was designed for). I'm guessing the error message has something to do with this, however I am not sure what to do next after this error message.

Luke Branch
on 7/2/14, 3:19 AM
1

Bole

--Bole--
2385
| 5 4 6
Zagreb | Karlovac, Croatia
--Bole--

there is only 10 kind of people the ones that understand binary ... and others

Bole
On 7/2/14, 5:53 AM

try putting dependency for module "product" in __openerp__.py of your module

Hi Bole, Thanks for the reply, i'll give it a go and post back here later with what I find.

Luke Branch
on 7/2/14, 6:00 AM
0

Ludo - Neobis

--Ludo - Neobis--
2387
| 2 2 5
Hoogvliet, Netherlands
--Ludo - Neobis--

Developer

Ludo - Neobis
On 7/2/14, 3:58 AM

According to your next error log, it is somewhere in your product_image_SO module, in the product_view.xml file. Is that string "product.product.treeproduct.product" the <field "name"> record? Or is it the inherit record? If it is the inherit record, you must reference the module.xml_id like so; <field name="inherit_id" ref="project.view_task_form2"/> (just an example for projects).

Hi Ludo, Thanks for your reply. I'll try what you have suggested and post back here with the results later.

Luke Branch
on 7/2/14, 4:44 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

2 follower(s)

Stats

Asked: 6/27/14, 5:25 AM
Seen: 4314 times
Last updated: 3/16/15, 8:10 AM