Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
Hello, I am developing a module in Odoo 8 and I have a very strange problem. I added a One2many field in product.pricelist.version model, and in account.voucher model I have the corresponding Many2one field.
_inherit = 'product.pricelist.version'
pays= fields.One2many('account.voucher', 'pricelist_version_id')
Then, I override the create method of product.pricelist.item model.
def create(self, cr, uid, vals, context=None):
id_pricelist = super(product_pricelist_item, self).create(cr, uid, vals, context)
pricelist_item_obj = self.browse(cr, uid, id_pricelist, context)
pricelist_version_obj = pricelist_item_obj.price_version_id
When I create a pricelist.version with one or more "pays", I do some logic. If I check the lenght with "len(pricelist_version_obj.pays)" I get 0! Why?! If I do "len(pricelist_item_obj.items_id)" I get the correct number of items...
About This Community
This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 12/17/14, 5:24 PM|
|Seen: 910 times|
|Last updated: 3/16/15, 8:10 AM|