I just recited qweb:
- I created an additional fileds to upload photos to the stock.location table
-location has paternity
-up up photos for father location
-in report mrp_repair I want to rely on "Current Location
"to retrieve the image to display on the report.
I just approached qweb:
I am having an error showing the image to show, very grateful for the help
class MrpRepair(models.Model):
_inherit = 'mrp.repair'
img_location_compute = fields.Binary(compute="_compute_img_location")
@api.multi
def _compute_img_location(self):
has_img = self
while not has_img.img_location and has_img.location_id:
has_img = has_img.partner_id
self.img_location_compute = has_img.img_locationclass StockLocation(models.Model):
_inherit = "stock.location"
img_location = fields.Binary('Địa chỉ location')<img t-if="location_id.location_id.img_location" t-att-src="'data:image/png;base64,%s' % location_id.location_id.img_location"/>
thanks. but it doesn't work with me. .I don't know what's going on,