CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have a cycle like this.
for i in ids:
self.pool.get('product.product').create(cr, uid, vals, context = context)
Now in empty system this is not cause any matter, but what is a risk, for this kind of execution? Think of live system with user activites, and so on.
If has what is a different's between 6.1, 7.0, 8.0 versions?
You should NEVER call cr.commit() yourself, UNLESS you have created your own database cursor explicitly! And the situations where you need to do that are exceptional!
And by the way if you did create your own cursor, then you need to handle error cases and proper rollback, as well as properly close the cursor when you're done with it.
About This Community
Odoo Training Center
|Asked: 8/22/14, 12:30 PM|
|Seen: 7612 times|
|Last updated: 11/24/16, 6:41 PM|