To generate a barcode using that way you need to have installed reportlab dependency and the module 'report' that it's auto-installed when base and web modules are installed, check those prerequisites and if they are ok you could always test in the browser your barcode image using this url in your case:
http://localhost:8069/report/barcode/Code128/test-0001
that will return you the barcode image generated, If some other error shows in the logs post it here. If the barcode not get generated and the logs doesn't show anything, then you need to debug what happens at /openerp/addons/report/controllers/main.py on the report_barcode method.
===========================================================================================
I test it and debug it and seems that you cannot do that because the request to the controller came with no session_id and also no database to use and get dropped with a 404. Your alternative could be to directly generate the barcode image using the same code of the barcode controller but used from a report parser. Define a function in a parser like:
import base64
from openerp.report import report_sxw
from reportlab.graphics.barcode import createBarcodeDrawing
class barcode_report_parser(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(barcode_report_parser, self).__init__(cr, uid, name, context=context)
self.localcontext.update({
'barcode': self.barcode,
})
def barcode(self, type, value, width=600, height=100, humanreadable=0):
width, height, humanreadable = int(width), int(height), bool(humanreadable)
barcode_obj = createBarcodeDrawing(
type, value=value, format='png', width=width, height=height,
humanReadable = humanreadable
)
return base64.encodestring(barcode_obj.asString('png'))
In the report template define your image like this:
<img t-att-src="'data:image/png;base64,%s' % barcode('Code128','test-0001')" style="width:100%;height:25px"/>
I tried http://localhost:8069/report/barcode/Code128/test-0001 and the barcode is returned without problem, I have another report which also shows one barcode and it works perfectly, but with this example I get a 404 Error, the unique difference is the way of calling the report, the report that show me the barcode is called from Print option at page header, and this report is called from method.