Add bootstrap css to odoo report - report

I'm create report with bootstrap element...https://postimg.org/image/nyoith02t/
Look is not good, how add bootstrap path on report, or inherit from other module?
My module location is odoo9 / custom_module / my_module (not in addons).

Create A Report With an Empty STYLE TAG.
<openerp>
<data>
<report
id="report_for_my_model"
model="myaddon.mymodel"
string="Report"
name="myaddon.report_view"
file="myaddon.report_for_my_model"
report_type="qweb-pdf"/>
<template id="report_view">
<style type="text/css">
</style>
<t t-call="report.html_container">
<t t-foreach="docs" t-as="doc">
<t>
<div class="page">
<!-- YOUR REPORT HERE -->
</div>
</t>
</t>
</t>
</template>
</data>
</openerp>
Then create another file and paste bootstrap's css inside it. I am not sure if you can use minified. You also may have to replace < with < but I am not entirely sure. This technique works for simple css, I know that as I use it.
<openerp>
<data>
<template id="myaddon_bootstrap_style" inherit_id="myaddon.report_view">
<xpath expr="//style" position="after">
<style type="text/css">
/*
YOUR CSS HERE
*/
</style>
</xpath>
</template>
</data>
</openerp>

Related

How to add function print reciept for my custom button in POS odoo 11?

I have created my custom button in POS odoo 11 in template PaymentScreenWidget, i cannot find out the way to give it a function print reciept. How can i do that?
My Button in mymodule/static/src/xml/....xml
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-name="PaymentScreenWidget" t-extend="PaymentScreenWidget">
<t t-jquery='.payment-buttons' t-operation='append'>
<div class="control-button">
Custom Button
</div>
</t>
</t>
</templates>
My js file
odoo.define('POS.pos', function (require) {
'use strict';
var models = require('point_of_sale.models');
var core = require('web.core');
var Widget = require('web.Widget');
var screens = require('point_of_sale.screens');
var gui = require('point_of_sale.gui');
var qweb = core.qweb;
});
My views/...xml
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="demo_example_ext_js" name="Demo Example Ext Js" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/POS/static/src/js/pos.js"></script>
</xpath>
</template>
</odoo>

How to upload and save a picture with eXist-db?

I am tryng to upload a picture and store it in exist-db but i get the next error when opening the stored picture:
Cannot open specified file: Could not recognize image encoding.
I have tryed the next code with a small adjustment for normal txt files and it works fine but not with pictures.
picture.xhtml
<?xml-model href="http://www.oxygenxml.com/1999/xhtml/xhtml-xforms.nvdl" schematypens="http://purl.oclc.org/dsdl/nvdl/ns/structure/1.0"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xf="http://www.w3.org/2002/xforms"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<head>
<title/>
<xf:model>
<xf:instance xmlns="">
<data>
<image xsi:type="xs:base64Binary"/>
</data>
</xf:instance>
<xf:submission id="save" action="save.xquery" method="post"/>
</xf:model>
</head>
<body>
<xf:upload ref="image">
<xf:label>Upload Photo:</xf:label>
</xf:upload>
<br/>
<xf:submit submission="save">
<xf:label>Save</xf:label>
</xf:submit>
</body>
</html>
save.xquery
xquery version "3.1";
declare option exist:serialize "method=xhtml media-type=text/html indent=yes";
let $login:=xmldb:login('xmldb:exist:///db/apps/places','admin','admin')
(: The small adjusment i refer is just to change file extension from .jpeg to .txt :)
return xmldb:store("/db/apps/places/",concat("pic",".jpeg"), util:base64-decode(request:get-data()//image))
If you want to store images to the eXist-db you should probably replace xmldb:store() with xmldb:store-as-binary().

Displaying HTML from Meteor template rendered or unrendered depending on situation

I want to provide users with a snippet of HTML they can copy and paste, and show them a preview of what it will look like. So far I'm doing this with two templates with the same content, only one of them has the HTML escaped like this:
<template name="pageTemplate">
...
{{> tryItOut}}
{{> getCode}}
...
</template>
<template name="tryItOut">
<div>...</div>
<script src="script.js"></script>
<script type="text/javascript">...</script>
</template>
<template name="getCode">
<div>...</div>
<script src="script.js"></script>
<script type="text/javascript">...</script>
</template>
So in the tryItOut section they can play with the tool as it would appear on their site, and in the getCode section they will see something like this (which they can copy and paste):
<div>...</div>
<script src="script.js"></script>
<script type="text/javascript">...</script>
How can I do this using only one template?
Add the meteor markdown package with: $ meteor add markdown
Use it as follows:
pageTemplate.html
<template name="pageTemplate">
...
{{> tryItOut}}
{{#markdown}}
{{> tryItOut}}
{{/markdown}}
...
</template>
<template name="tryItOut">
<div>...</div>
<script src="script.js"></script>
<script type="text/javascript">...</script>
</template>

Polymer recursive template binding

I'm struggling having to migrate a custom element that used a recursive template binding in Polymer 0.5. The custom element's HTML code was like:
<template>
<template bind="{{ items }}" id="t">
<section id="{{ id }}" appName="{{ id }}">
<template ref="t" repeat="{{ children }}"></template>
</section>
</template>
</template>
How could I write the same construct in Polymer 0.9? if the feature is not supported yet, are there plans to include it in Polymer's future versions?
Thanks
You can include a custom element inside of itself:
my-recursive.html
<link rel="import" href="../polymer/polymer.html">
<dom-moduleĀ id="my-recursive">
<template>
<template is="dom-repeat" items="{{data}}">
<section id="{{item.id}}" appName="{{item.id}}">
<my-recursive data="{{item.children}}"></my-recursive>
</section>
</template>
</template>
</dom-module>
<script>
Polymer({
is: 'my-recursive'
});
</script>
index.html
<my-recursive
data='[{"id":1,"name":"top1","children":[{"id":3,"name":"mid1","children":[]},{"id":5,"name":"mid3","children":[]}]},{"id":2,"name":"top2","children":[{"id":4,"name":"mid2","children":[]}]}]'
></my-recursive>

Export HTML Table & its style to PDF in ColdFusion

I'm working on ColdFusion trying to export a HTML table to PDF document. This HTML table is deriving its style from an external CSS file. The issue is that when exporting, the table format is not exporting in the pdf document. I need to export the table as its rendered on the browser(along with its formatting).
Following is the code for the same.
Content.cfm
<cfsavecontent variable="pdfREPORT">
<table id="dep" class="main_table" cellpadding="0">
<tr class="h1">
<th>cell1</th>
<th>cell2</th>
<th>cell3</th>
<th>cellN</th>
</tr>
.
.
.
<cfoutput query="qry1">
<tr>
<td>#qry1.col1#</td>
<td>#qry1.col2#</td>
<td>#qry1.col3#</td>
<td>#qry1.colN#</td>
</tr>
</cfoutput>
</table>
</cfsavecontent>
extract_to_pdf.cfm
<cfsetting enablecfoutputonly="true">
<cfheader name="Content-Disposition" value="inline;filename=test.pdf">
<cfcontent type="application/pdf">
<cfdocument format="PDF" localurl="yes" marginTop=".25" marginLeft=".25" marginRight=".25" marginBottom=".25"
pageType="custom" pageWidth="8.5" pageHeight="10.2" mimetype="text/html">
<html>
<head>
<style>
<cfinclude template = "styles/tableStyle.css">
</style>
</head>
<body>
<cfoutput>#Form.pdfREPORT#</cfoutput>
</body>
</html>
</cfdocument>
Any help is highly appreciated.
Showing the code you're working with would help us answer this question but, do you have your CSS link inside your cfdocument block? If you do and it still isn't working, try:
<cfdocument ...>
<html>
<head>
<style>
<cfinclude template = "yourCSSfile.css">
</style>
</head>
<body>
<table>
...
</table>
</body>
</html>
</cfdocument>

Resources