I am wondering how I get other fields values of a one2many related model (and field)...?
first LOC (extending Magento Bridge by Webkul in product.template) is - unsing the old API:
'mage_sync_id': fields.one2many('magento.product.template','template_name','Magento Sync Id', readonly=True),
and I thought this might do it, but nothing comes out - maybe only works on many2one field relations, which would make sense:
'update_date': fields.related('mage_sync_id', 'write_date', type="datetime", relation='magento.product.template',readonly=True, store=True, string="Updated Date"),
So I must compute the field and search the many entries behind mage_sync_id for a special field and get out the values?
But how can I do that?
Something like this?
related_recordset = self.env["magento.product.template"].search()
self.products = related_recordset.update_date
Messing up with verions?
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
About This Community
|Asked: 10/27/16, 3:21 PM|
|Seen: 152 times|
|Last updated: 10/27/16, 6:39 PM|