I have a float field called "price". I want to import the data from spreadsheet. the data is from user. assume the data is not clean and need to be handled first, how can I handle if there is foreign symbol in the data?
for example. in the first row, the price should be empty. but the user fill it with "-". then this error should appear "Column price contains incorrect values (value: -)"
before it tries to test, I want to handle it first by replacing all characters into either empty or numeric
I already tried this
@api.model
def create(self, vals_list):
for val in vals_list:
for v in val:
if val[v] in ['-', ' ']:
val[v] = ''
but the error when importing still appear