This question has been flagged
3 Replies
3940 Views

I have successfully migrated my openerp 7 databases to odoo 8.

I am running odoo from docker using the official docker hub image.

Everything is fine except my customer invoices do not print correctly : I have no header and footer at all (all my company information is basically gone.

I guess this is due to the Qweb reporting scheme so I tried to dig a little into that, modifying the reports.

I followed th odoo guide tutorial at http://odoo.guide/odoo-report-design-basics/ which is not very helpfull as I am continuously stuck in server errors with missing documents (see my stack overflow question on the subject http://stackoverflow.com/questions/32078894/impossible-to-create-a-custom-report-in-odoo-8

I tried to modify the external_layout_header manuall to see what happens with no success again.

I need possible tracks to follow from there, either a simple, no python coding required, documentation to understand why the inital installation does not find out the company header information, or a way to find out what actual document is not found by odoo server when the trace says there is a missing document.


Thanks in advance,

Avatar
Discard
Author

Marvin's answer is unfortunately not the solution. On my "real life system", I have updated the fonts for my company. Preview header/footer on the company page works fine. Just on customer invoices, doing "print-Invoices" does not get the header/footer on the invoices, as if the report structure behind print invoice was not able to get to the RML header. No missing document in that case. Would that be possibly due to RML-QWEB problems in the invoice report? The missing document happens on a sandbox environment I started from scratch and has probably more to do with inconsistent external ids from the report structure I created from scractch following the odoo.guide tutorial..

Author Best Answer

Nothing to do with fonts. Docker official image can not manage its way to reports if report.url key is not defined as  http://0.0.0.0:8069 in settings/Technical/Systems parameters/parameters. See https://github.com/odoo/docker/issues/24

Avatar
Discard
Best Answer

Hello Yves,

Odoo 8 introduced a new model `res.font` and also a new Many2One relational field at `res.company` that references a particular font record, please see here:

https://github.com/odoo/odoo/blob/8.0/openerp/addons/base/res/res_company.py#L127 

This new field has a default value defined (when no value is provided) but it's not required:

https://github.com/odoo/odoo/blob/8.0/openerp/addons/base/res/res_company.py#L407 

https://github.com/odoo/odoo/blob/8.0/openerp/addons/base/res/res_company.py#L298 

Preexisting `res.company` records in a database migrated from v7 to v8 will have None/null for this field.

New company records will have the field appropriately defined because the create/update form has been updated to set this field:

https://github.com/odoo/odoo/blob/8.0/openerp/addons/base/res/res_company_view.xml#L91 

The missing document error usually appears when code traverses a relational field which is evaluated to None/null.

You may try editing your company record in order to appropriately set the font field and try again.

Please let us know if this fixes your issue.

Regards.

Additional note:

I also noted that font names in templates changed from v7 to v8, most likely by the introduction of the `res.font` model. Compare the following sources, where we have "DejaVu Sans" for v7 and "DejaVuSans" for v8:

https://github.com/odoo/odoo/blob/7.0/openerp/addons/base/res/res_company.py#L271 

https://github.com/odoo/odoo/blob/8.0/openerp/addons/base/res/res_company.py#L303 

And here are their corresponding definitions for v7 and v8:

https://github.com/odoo/odoo/blob/7.0/openerp/report/render/rml2pdf/customfonts.py#L45 

https://github.com/odoo/odoo/blob/8.0/openerp/addons/base/res/res_font.py#L43 

I think you will also need to update your font references to correct them.

Avatar
Discard