I'm developing a module that should add a field Related Products. I added a many2many field
class product_template(osv.Model):
_name = 'product.template'
_inherit = 'product.template'
_columns = {
'related_products': fields.many2many('product.template', 'rel_related_product', 'product_id', string="Related Products"),
}
The problem is that I can relate the product only one way. I.e. if I relate ProductB to ProductA, I can only see the relationship inside ProductA and not the otherway around
How can I solve that?
AFAIK you've to add relation fields in both classes, further check if you've to use the same helper table or different ones in both modules ( 'rel_related_product' ?) and you're missing 'other.object.id' in a definition. please refer to documentation.