Community mailing list archives

community@mail.odoo.com

Re: 404 when getting CSS for qweb report

by
Camptocamp France SAS, Alexandre Fayolle - Camptocamp
- 05/06/2016 05:37:48
Thanks Nhomar,

the css was there. The issue was that the action I was returning from
the server was missing some fields (hand made dictionary, I'm not quite
sure which one precisely was missing). This was causing wkhtmltopdf to
connect back to Odoo without the proper credentials / without specifying
a database (I'm not sure exactly which, and can't afford to loose more
time on this issue). This makes web/content not available as request
handler -> 404 on all the URLs

Returning it using Report.get_action() fixed the issue.

As a side note, I'm pretty sure my first experiments with the action and
the report had all the css properly generated, and that things changed
when I updated the report to store the pdf in attachment.

Someday I'll have to spend time tracing the different paths of execution
in report.py... It works most of the time, but it's hell to debug...

Alexandre

On 06/05/2016 10:41, Nhomar Hernandez wrote:
> 
> On Thu, May 5, 2016 at 6:21 AM, Alexandre Fayolle
> <alexandre.fayolle@camptocamp.com
> <mailto:alexandre.fayolle@camptocamp.com>> wrote:
> 
>     2016-05-05 11:15:43,073 24872 INFO ? werkzeug: 127.0.0.1 - -
>     [05/May/2016 11:15:43] "GET
>     /web/content/418012-a62486a/report.assets_pdf.0.css HTTP/1.1" 404 -
>     2016-05-05 11:15:43,081 24873 INFO ? werkzeug: 127.0.0.1 - -
>     [05/May/2016 11:15:43] "GET
>     /web/content/418007-02ab18d/report.assets_common.0.css HTTP/1.1" 404 -
>     2016-05-05 11:15:43,304 24872 INFO ? werkzeug: 127.0.0.1 - -
>     [05/May/2016 11:15:43] "GET
>     /web/content/418012-a62486a/report.assets_pdf.0.css HTTP/1.1" 404 -
>     2016-05-05 11:15:43,304 24873 INFO ? werkzeug: 127.0.0.1 - -
>     [05/May/2016 11:15:43] "GET
>     /web/content/418007-02ab18d/report.assets_common.0.css HTTP/1.1" 404 -
> 
> 
> It happens to me frequently, supposing it is what happens to me, force
> recompile the CSS.
> 
> *Hypothesis 1:*
> 
> 
> 1.- Run as ?debug= enabled in order to force download your css file by file.
> 2.- Go to attachments and find all attachments that finish with css,
> delete the records.
> 3.- Delete you filestore/addons folder.
> 4.- Restart.
> 
> I did not reproduce it yet properly but in certain circumstances (mostly
> when move from one server to another or with some broken updates) it
> happens to me and with that1 sequence it is solved.
> 
> Let me know if it works for you.!
> 
> *Hypothesis 2 (if v9.0):*
> 
> Do you have configured the CDN feature in your server? if yes, disable
> it, the /content/ part of your url looks like that is the problem.
> 
> Regards.
> 
> -- 
> Nhomar Hernandez
> CEO Vauxoo.
> Site: http://vauxoo.com
> Twitter: @nhomar
> Blog: http://nhomar.com
> Github User: https://github.com/nhomar
> Odoo Gold Partner
> Skype: nhomar00 (Envia mail previo no lo superviso siempre).
> HangOut: nhomar@vauxoo.com <mailto:nhomar@vauxoo.com>
> Móvil Venezuela:
> +58 4144110269
> Móvil México:
> +52 1 4773933942
> 
> _______________________________________________
> Mailing-List: https://www.odoo.com/groups/community-59
> Post to: mailto:community@mail.odoo.com
> Unsubscribe: https://www.odoo.com/groups?unsubscribe
> 


-- 
Alexandre Fayolle
Chef de Projet
Tel : +33 4 58 48 20 30

Camptocamp France SAS
Savoie Technolac, BP 352
73377 Le Bourget du Lac Cedex
http://www.camptocamp.com