TypeError: can't multiply sequence by non-int of type 'unicode'

TypeError: can't multiply sequence by non-int of type 'unicode'

@api.onchange('length','width')

def _compute_size_id(自己):

    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)