Custom Header and Footer not displayed in odoo11 - wkhtmltopdf

I'm creating a report in odoo 11 where i want to print repeatable headers and footers. Below is my code to do the same.
Header Code
<div class="header">
<img height="160" src='/module_name/static/src/img/'/>
</div>
Footer Code
<div class="footer">
<img height="160" src='/module_name/static/src/img/'/>
</div
And i'm using wkhtmltopdf version - 0.12.4. In this version the custom footer is working properly but the header isn't working.
Further Research
When trying with wkhtmltopdf version - 0.12.1 - In this version the default header was displaying despite overriding the header with custom header
When trying with wkhtmltopdf version - 0.12.2.2 - In this version no header and footer was displayed (not even the default)
When trying with wkhtmltopdf version - 0.12.2.4 - In this version no header and footer was displayed (not even the default)
Any help is much appreciated to bring both custom header and footer. Thanks in advance.

<div class="header">
</div>
please comment the above code technical -> views -> internal_layout
after call to internal_layout like this
<t t-call="web.internal_layout">
<t t-foreach="docs" t-as="o">
<div class="page" style="font-family: 'helvetica'; font-size: 8pt;">
<div class="header">

Related

Turbolink is not working in Livewire version 2

i am working on my new project and technology stack is: laravel 8 + Livewire V2 + Jetstream, to create a single page application (SPA). but I am still confused if its possible SPA in my selected technology stack or not.
I know Livewire no longer supports Turbolinks out of the box so they provided Turbolinks adapter. I have followed the documentation but seems like its not working. please help me to understand the issue and let me know if SPA is possible or not in Livewire version 2.
here is my code:
<div class="min-h-screen bg-gray-100">
#livewire('navigation-menu')
<!-- Page Heading -->
#if (isset($header))
<header class="bg-white shadow">
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
{{ $header }}
</div>
</header>
#endif
<!-- Page Content -->
<main>
{{ $slot }}
</main>
</div>
#stack('modals')
#livewireScripts
<script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks#v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false"></script>
Livewire Version 1 supported Turbolinks internally. Livewire Version 2 has removed internal support and extracted it into this plugin.
The goal of this livewire version 2 is to provide full Turbolinks/Turbo support in Livewire.
add hotwired/turbo package on your layout below #livewireScripts
add livewire/turbolinks package on your layout below hotwired/turbo package
#livewireScripts
<script type="module">
import hotwiredTurbo from 'https://cdn.skypack.dev/#hotwired/turbo';
</script>
<script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks#v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false" data-turbo-eval="false"></script>
You need to install Turbolink module first, Please go Turbolinks documentation Here.
Support for Turbolink has been removed in Livewire 2. So you need to add an extra JS script to make it work.
More here => https://github.com/livewire/turbolinks
Just add this after your livewire script:
<script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks#v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false" data-turbo-eval="false"></script>
Example:
#livewireScripts
<script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks#v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false" data-turbo-eval="false"></script>

Vuejs view source - I can still see directives after compilation

When I compile my vuejs and then do a view source (chrome) I still see the directives and variable place holders?
<nav #click="toggleNav"></nav>
<span class="title">{{ pageName }}</span>
I am pulling it in via
<script src="https://unpkg.com/vue/dist/vue.js"></script>
When I try to validate via the W3c I get loads of errors. Should these not be compiled down?
Should I make anything with a directive on it a component so it does not show in my html?

How to use google embed pdf viewer in laravel 5.3?

I tried this
<div class="row" style="text-align: center;">
<iframe src="{{ asset('jurnal/' . $journal->file) }}&embedded=true" style="width:90%; height:500px;" frameborder="0"></iframe>
</div>
Shows me error : NotFoundHttpException in RouteCollection.php line 161:
Anyone can help please, thank you
You actually need to link to Google's viewer, not just your file...
<iframe
src="http://docs.google.com/gview?url={{ asset('jurnal/' . $journal->file) }}&embedded=true"
style="width:600px; height:500px;"
frameborder="0">
</iframe>
Also it looks like the link you are returning isn't a good link to the PDF file. If you go to that page in a browser, it shouldn't show you a NotFoundHttpException

Godoc stylesheet and javascript

I know Godoc -html generates HTML only without stylesheets and javascript, but once generated where can I get those from?
I got css and js from godoc.org but it seems the js doesn't work with the html markup that is generated by godoc
I just want to try this out without using godoc server
Example markup:
<div id="pkg-overview" class="toggleVisible">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
<p>Hello World
</p>
</div>
</div>
You can try and have a look in tools#hg/godoc/static
You will find a godoc/static/godocs.js which might help.
It is used by godoc/static/godoc.html anyway.
godoc.html also uses:
godoc/static/style.css
godoc/static/jquery.treeview.css

twitter bootstrap popover within a dropdown menu not working

<div class="btn-group">
<button class="btn dropdown-toggle" data-toggle="dropdown"> Reviews </button>
<button class="btn dropdown-toggle" data-toggle="dropdown"><span class="caret"></span></button>
<ul class="dropdown-menu">
<li>testuser 2012/08/12 12:25:42:836 PM</li>
<li>testuser11 2012/08/13 12:25:42:836 PM</li>
</ul>
</div>​
I am using bootstrap.min.js v2.0.4 and jquery 1.7.2, tried with jquery 1.8.0 and 1.7.1 with same results
I have this js code in tbspopover.js -
jQuery(function(){
$('a[rel=popover]').popover();
});
Script Order
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script src="/vendor/bootstrap.min.js"></script>
<script src="/js/views/tbspopover.js"></script>
The js function to enable popover was called before the element was added to DOM. The DOM element wasn't added until after ajax call was done. Found a tip here
With an older Version (2.0.2) of Bootstrap it should work.
You can find a working example here.
Older Versions of Twitter Bootstrap can be found on Github here.
I had a similar issue, it was because font-size of .btn-group was set to ZERO!!

Resources