Hello all!
What is the utility of the [ ] that surround the voucher.id variable in this line?
self.write(cr, uid, [voucher.id], { 'move_id': move_id, 'state': 'posted', 'number': name,})
Thanks
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello all!
What is the utility of the [ ] that surround the voucher.id variable in this line?
self.write(cr, uid, [voucher.id], { 'move_id': move_id, 'state': 'posted', 'number': name,})
Thanks
function Write take a list of ids as parameter.
So that allow to pass the singleton id as a list.
id = 2
[id] = [2]
Thanks mister!
Its the array variant of python they dont call them arrays but lists. But just as an array in for example php you can pop, remove, append, index, insert, reverse them :)
Lists in Python
https://docs.python.org/2/tutorial/datastructures.html
Arrays in Java and PHP (simular)
http://php.net/manual/en/language.types.array.php
http://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up