python调用自定义模块出错_安装自定义模块(最近调用最后一次)时出错

在尝试安装自定义Odoo模块时遇到了IndentationError,具体错误发生在销售审批模块的导入过程中。错误指出在'salesapproval.py'文件的第3行缺少缩进。文章描述了错误的回溯信息,并提供了可能涉及的代码片段。
摘要由CSDN通过智能技术生成

安装模块时出现此错误

我试着做两个水平

销售订单验证

回溯(最近一次呼叫)Traceback (most recent call last):

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/http.py", line 537, in handle_exception

return super(JsonRequest, self).handle_exception(exception)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/http.py", line 574, in dispatch

result = self._call_function(*self.params)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/http.py", line 310, in _call_function

return checked_call(self.db, *args, *kwargs)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/service/model.py", line 118, in wrapper

return f(dbname, args, *kwargs)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/http.py", line 307, in checked_call

return self.endpoint(a, *kw)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/http.py", line 803, in __call

return self.method(args, *kw)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/http.py", line 403, in response_wrap

response = f(args, *kw)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/addons/web/controllers/main.py", line 948, in call_button

action = self.call_kw(model, method, args, {})

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/addons/web/controllers/main.py", line 936, in call_kw

return getattr(request.registry.get(model), method)(request.cr, request.uid, args, *kwargs)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/api.py", line 256, in wrapper

return old_api(self, args, *kwargs)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/addons/base/module/module.py", line 447, in button_immediate_install

return self._button_immediate_function(cr, uid, ids, self.button_install, context=context)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/api.py", line 256, in wrapper

return old_api(self, args, *kwargs)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/addons/base/module/module.py", line 495, in _button_immediate_function

registry = openerp.modules.registry.RegistryManager.new(cr.dbname, update_module=True)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/modules/registry.py", line 370, in new

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

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/modules/loading.py", line 355, in load_modules

loaded_modules, update_module)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/modules/loading.py", line 255, in load_marked_modules

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

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/modules/loading.py", line 143, in load_module_graph

load_openerp_module(package.name)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/modules/module.py", line 315, in load_openerp_module

__import('openerp.addons.' + module_name)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/modules/module.py", line 80, in load_module

mod = imp.load_module('openerp.addons.' + module_part, f, path, descr)

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/addons/sales_approval/init.py", line 1, in

import salesapproval

File "/opt/bitnami/apps/odoo/lib/odoo-8.0.post20151126-py2.7.egg/openerp/addons/sales_approval/salesapproval.py",

line 3

_inherit = 'sale.order'

^

IndentationError: expected an indented block

这是我的档案

初始化.py

^{pr2}$

打开程序.py

^{3}$

出售_近似xml在<?xml version="1.0" encoding="utf-8"?>

sale.order

states="draft,sent" groups="base.group_user"/>

art_approved

draft,sent,art_approved

draft,sent,art_approved

在销售审批.py在from openerp.osv import osv, fields

class salesapproval_sale_order(osv.Model):

_inherit = 'sale.order'

_columns = {

'state': fields.selection(

[('cancel', 'Cancelled'),('draft', 'Draft'),('confirmed', 'Confirmed'),('exception', 'Exception'),('done', 'Done')],

'Status', required=True, readonly=True, copy=False,

help='* The \'Draft\' status is set when the related sales order in draft status. \

\n* The \'Confirmed\' status is set when the related sales order is confirmed. \

\n* The \'Exception\' status is set when the related sales order is set as exception. \

\n* The \'Done\' status is set when the sales order line has been picked. \

\n* The \'Cancelled\' status is set when a user cancel the sales order related.'),

}

提前谢谢

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值