我试图安装模块product_print_zpl_barcode
在odoo 9.本模块用于增加产品变型向导生成和ZPL打印机上打印产品条形码。 我得到的错误:
类型错误:浮子()参数必须是字符串或数字
当我按下按钮“打印条形码”。
这里是源代码和错误:
product_print_zpl_barcode.py
# -*- coding: utf-8 -*-
from openerp import models, fields, api, _
from openerp.exceptions import UserError
from openerp.tools import float_compare, float_is_zero
import openerp.addons.decimal_precision as dp
import base64
import re
class ProductPrintZplBarcode(models.Model):
_name = 'product.print.zpl.barcode'
_description = 'Generate and print product barcodes in ZPL'
@api.depends('pricelist_id', 'quantity', 'product_id')
def _compute_price(self):
# for regular barcodes
for wiz in self:
if wiz.pricelist_id and wiz.product_id:
price_uom = wiz.pricelist_id.price_get(wiz.product_id.id, 1)
wiz.price_uom = price_uom
wiz.price = price_uom * wiz.quantity
return wiz.price
追溯
Traceback (most recent call last):
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\http.py", line 650, in _handle_exception
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\http.py", line 687, in dispatch
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\http.py", line 323, in _call_function
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\service\model.py", line 118, in wrapper
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\http.py", line 316, in checked_call
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\http.py", line 966, in __call__
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\http.py", line 516, in response_wrap
File "D:\Projet_Odoo\Odoo 9.20180426\server\openerp\addons\web\controllers\main.py", line 896, in call_kw
File "D:\Projet_Odoo\Odoo 9.20180426\server\openerp\addons\web\controllers\main.py", line 888, in _call_kw
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\api.py", line 250, in wrapper
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\api.py", line 381, in old_api
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\models.py", line 6067, in onchange
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\models.py", line 5770, in __getitem__
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\fields.py", line 834, in __get__
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\fields.py", line 949, in determine_draft_value
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\fields.py", line 895, in compute_value
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\fields.py", line 885, in _compute_value
File "D:\Projet_Odoo\Odoo 9.020180426\server\openerp\addons\product_print_zpl_barcode\models\product_print_zpl_barcode.py", line 100, in _compute_price
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\fields.py", line 847, in __set__
File "D:\Projet_Odoo\Odoo 9.0-20180426\server\.\openerp\fields.py", line 1177, in convert_to_cache
TypeError: float() argument must be a string or a number