Hi!

I develop a wizard at sale module. When the wizard finish I create some sale lines. I develop it with tryton-3.0.

I would like to migrate the module to 3.2, but with the same code gives me an error that I don't understand why its happening.

Here is an example code. You also can find the code at pastebin ( http://pastebin.com/XDSFhLTQ )
```
pool = Pool()
t = Transaction()
sale_line_obj = pool.get('sale.line')
line = sale_line_obj()

line.sale = t.context.get('active_id')
line.type = 'line'
line.quantity = 100
line.product = 1 # First product. default_uom and sale_uom is 'unit'
line.unit = 1 #Using 'unit'
line.unit_price = Decimal('1')
line.description = 'Example sale line'
sale_line_obj.save(line)
```

Returns:
*** UserError: ('UserError', (u'The value of the field "Unit" on "Sale Line" is not valid according to its domain.', ''))

It seems that the problem is with the validate_domain() method at modelstorage.py file. From 3.0 to 3.2 that piece of code changed.

If you think that there is a bug, I can open a ticket at the bugtracker.

Thanks!
--
Luciano Rossi
gcoop - Cooperativa de Software Libre
www.gcoop.coop
(0054 11) 4855-4390 Juan Ramírez de Velasco 508 Depto A

Reply via email to