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

Error when trying install custom module

By
rudyanto santoso
on 9/6/15, 12:48 AM 1,184 views

I have strange conditions, I made a simple module like this


from openerp.osv import orm, fields

import openerp.addons.decimal_precision as dp

class sale_order_line(orm.Model):

_name = 'sale.order.line'

_inherit = 'sale.order.line'

_columns = {

'base_price':fields.float('Base Price', required=True, digits_compute=dp.get_precision('Product Price'), readonly=True, states={'draft':[('readonly', False)]}),

}

_default = {

'base_price': 0.0,

}

and made a view like this


<?xml version="1.0"?>

<openerp>

<data>

<record model="ir.ui.view" id="view_order_form">

<field name="name">sale.order.form</field>

<field name="model">sale.order</field>

<field name="inherit_id" ref="sale.view_order_form"/>

<field name="type">form</field>

<field name="arch" type="xml">

<xpath expr="//form/sheet/notebook/page/field[@name='order_line']/form/group/group/field[@name='price_unit' ]" position="before">

<field name="base_price"/>

</xpath>

<xpath expr="//form/sheet/notebook/page/field[@name='order_line']/tree/field[@name='price_unit' ]" position="before">

<field name="base_price"/>

</xpath>

</field>

</record>

</data>

</openerp>

After i installed this module, I cannot install another module anymore even built-in module from odoo.

I have an error like this


Odoo Server Error

Traceback (most recent call last):

File "E:\Odoo 8.0\server\.\openerp\http.py", line 537, in _handle_exception

File "E:\Odoo 8.0\server\.\openerp\http.py", line 574, in dispatch

File "E:\Odoo 8.0\server\.\openerp\http.py", line 310, in _call_function

File "E:\Odoo 8.0\server\.\openerp\service\model.py", line 113, in wrapper

File "E:\Odoo 8.0\server\.\openerp\http.py", line 307, in checked_call

File "E:\Odoo 8.0\server\.\openerp\http.py", line 803, in __call__

File "E:\Odoo 8.0\server\.\openerp\http.py", line 403, in response_wrap

File "E:\Odoo 8.0\server\openerp\addons\web\controllers\main.py", line 948, in call_button

File "E:\Odoo 8.0\server\openerp\addons\web\controllers\main.py", line 936, in _call_kw

File "E:\Odoo 8.0\server\.\openerp\api.py", line 241, in wrapper

File "E:\Odoo 8.0\server\openerp\addons\base\module\module.py", line 446, in button_immediate_install

File "E:\Odoo 8.0\server\.\openerp\api.py", line 241, in wrapper

File "E:\Odoo 8.0\server\openerp\addons\base\module\module.py", line 494, in _button_immediate_function

File "E:\Odoo 8.0\server\.\openerp\modules\registry.py", line 370, in new

File "E:\Odoo 8.0\server\.\openerp\modules\loading.py", line 351, in load_modules

File "E:\Odoo 8.0\server\.\openerp\modules\loading.py", line 255, in load_marked_modules

File "E:\Odoo 8.0\server\.\openerp\modules\loading.py", line 152, in load_module_graph

File "E:\Odoo 8.0\server\.\openerp\modules\registry.py", line 163, in load

File "E:\Odoo 8.0\server\.\openerp\models.py", line 596, in _build_model

File "E:\Odoo 8.0\server\.\openerp\modules\registry.py", line 102, in __getitem__

KeyError: 'sale.order.line'


After that, my odoo server hang up with error like this


XmlHttpRequestError INTERNAL SERVER ERROR

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

<title>500 Internal Server Error</title>

<h1>Internal Server Error</h1>

<p>The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.</p>


Please help me, what kind of mistake i already made with this module. I already made another module before this and not found any error like this.

FYI, this module running well when installed, just after that, I cannot installing another module anymore.

Thanks Axel, It's worked!! I'm forgot to update depends because copy-paste.

rudyanto santoso
on 9/6/15, 10:11 PM
2

Axel Mendoza

--Axel Mendoza--
10298
| 7 7 8
Camaguey, Cuba
--Axel Mendoza--

DevOps - Full stack - Software Architect - Developer - Technology Integrator

I could help you to develop anything and solve complex problems based on technologies, integrations and tricky stuffs mostly in Python with OpenERP/Odoo, Zato, Django and many others frameworks programming languages and technologies.

I offers consulting services to anyone with an unanswered questions or needs for customizations. Think about it, maybe it's better to have an expert to solve your issues and projects than having a full time employee trying to understand what to do an how

Reach me at aekroft@gmail.com

Axel Mendoza
On 9/6/15, 1:36 PM

You need to put a depends with sale module in your __openerp__.py

0
rudyanto santoso
On 9/6/15, 4:25 AM

Thanks Dep, but I don't see solutions from link you gave to me. can you explain for me?

0

Odoo

--Odoo --
1328
| 5 2 5
kerala, India
--Odoo --

Working as a Odoo Functional and Technical Expert

Odoo
On 9/6/15, 1:23 AM

Hi,

Please Refer this Answer ,it will resolve your issue.......


https://www.odoo.com/forum/help-1/question/adding-custom-field-to-sales-order-product-lines-41789

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: 9/6/15, 12:48 AM
Seen: 1184 times
Last updated: 9/6/15, 10:12 PM