@api.ochange('长度','宽度'(
def_compute_size_id(self(:
for s in self:
if (s.length and s.width):
s.size_wise = s.length * s.width
您应该将变量强制转换为类型int:
@api.onchange('length','width')
def _compute_size_id(self):
for s in self:
if (s.length and s.width):
s.size_wise = int(s.length )* int(s.width)