I have created a custom report in odoo v10, and here is my report action
<report
id="my_custom_report_action"
string="Sale Report"
model="sale.order"
report_type="qweb-pdf"
name="module.custom_sale_report"
file="module.custom_sale_report"/>
now when the report get printed I wanted to name a file like sale_SO001.pdf
is there any way to achieve this?
To change the pdf file(in Odoo V10) you can alter the report action using the record.
<record id="my_custom_report_action" model="ir.actions.report.xml">
<field name="print_report_name">'sale_%s.pdf' % object.name</field>
</record>
hope this helps!
Related
I am developing a report in BI report using xsl template. I have a doubt regarding adding two fields. In rtf template we use <?xdofx: field1 + field2?>. But if I do the same in xls template, it shows an error
'Namespace prefix 'xdofx' used but not declared'. Can someone help me with this please?
I made a table in an RTF file using <?xdofx: value1 + value2?>. And rendered with Excel output as preview.
Try removing the xdofx: part. It's not necessary in the RTF template.
I'm using OpenERP 8 odoo
and I'm following the report creation tutorial
but I get stuck at where i can but the report record code
for example:
<report
id="account_invoices"
model="account.invoice"
string="Invoices"
report_type="qweb-pdf"
name="account.report_invoice"
file="account.report_invoice"
attachment_use="True"
attachment="(object.state in ('open','paid')) and
('INV'+(object.number or '').replace('/','')+'.pdf')"
/>
Thanks in advance
Reference :
http://blog.emiprotechnologies.com/create-qweb-report-odoo/
In General Directory file structure for creating the Qweb Report in ODOO
report directory file contain
__ init __.py file
which is use as the manifest file for any python module its kind of entry point of the python module. (add the entry point of the your_report_parser_class_file.py file)
your_report_parser_class_file.py file
your report parser class file used to contain the report related function and variables which you want to call in future in your report (In Qweb View)
view directory file contain
report_your_report_name.xml file
Which is used to add the report view file it mean that the file will be displaying the for the Qweb View
(Generally its uses the bootstrap class andour custom css and Qweb template engine tags for designing the Qweb report and also this file has the added in __ openerp__.py file )
report_menu_file.xml file
Add the menu xml file for add the menu to print the Qweb Report which is totally near and have the same folder as the __ openerp__.py file
(this file also has the add the entry in __ openerp__.py file )
In the current Plone 5 coredev buildout, I am trying to write a GenericSetup uninstall profile for an add-on that registers some css in cssregistry.xml. In Plone 5, portal_css and portal_javascripts are empty, with all those resources now automatically loaded in the Resource Registry instead. But there is no corresponding uninstall. If I have a single css resource, I get the following records in the Resource Registry:
<record name="plone.resources/resource-myaddon-stylesheets.conf">...</record>
<record name="plone.resources/resource-myaddon-stylesheets.css">...</record>
<record name="plone.resources/resource-myaddon-stylesheets.deps">...</record>
<record name="plone.resources/resource-myaddon-stylesheets.export">...</record>
<record name="plone.resources/resource-myaddon-stylesheets.init">...</record>
<record name="plone.resources/resource-myaddon-stylesheets.js">...</record>
<record name="plone.resources/resource-myaddon-stylesheets.url">...</record>
(I get all these even though I have no js resources, and they all have an empty value, except for the css record.)
In addition, there is a new <element> in the following record:
<record name="plone.bundles/plone-legacy.resources" interface="Products.CMFPlone.interfaces.resources.IBundleRegistry" field="resources">
...
<value>
...
<element>resource-myaddon-stylesheets</element>
</value>
</record>
As I create my GS uninstall profile, it's simple enough to remove the former 7 records in registry.xml. But how do I remove the single <element> from the latter record? I looked through the test in plone.app.registry, but removing an element does not seem to be covered.
Ultimately, it would be great if the uninstallation could be handled automatically, just like the installation is.
Seems like the workaround is to add something like this to Extensions/Install.py:
def _removeBundleFromRegistry():
logger.info('Removing bundle reference from registry')
record = 'plone.bundles/plone-legacy.resources'
resources = api.portal.get_registry_record(record)
if u'resource-myaddon-stylesheets' in resources:
resources.remove(u'resource-myaddon-stylesheets')
def uninstall(portal, reinstall=False):
if not reinstall:
...
_removeBundleFromRegistry()
...
Too bad.
You have to use something like this:
<record name="plone.bundles/plone-legacy.resources" interface="Products.CMFPlone.interfaces.resources.IBundleRegistry" field="resources">
<value purge="false">
<element remove="true">resource-myaddon-stylesheets</element>
</value>
</record>
You can see a working example in the uninstall profile of the brasil.gov.paginadestaque package.
How to remove the default name of the report in the print button without editing in the base class, i.e if I click print button, it display Receipt Slip and "GRN" (my custom report), all I need his to remove the "Receipt Slip" (default report name) from the print option without editing in the base class,
Here is my code,
python file
report_sxw.report_sxw('report.picking.list','stock.picking.in','my_report/report/incoming_shi pment.rml',parser=receipt)
XML file
<report auto = "False"
id="stock.report_stock_picking"
model="stock.picking.in"
name="picking.list"
string="GRN"
rml="my_report/report/incoming_shipment.rml"
usage="default"
/>
How to hide the "receipt slip" (default report name) and replace my custom report name.
And when I select all the record in the list view while printing, "Failed path too long" message, so how can we change the report name GNR.pdf and remove the invoice number from the report
try with this code, it will work
<report id="stock.report_picking_list_in"
model="stock.picking.in"
name="stock.picking.list.in"
string="GRN"
rml="my_report/report/incoming_shipment.rml"
/>
I have an RML file that generates a report in PDF format, but how can I generate the same report in ODT format?
Under the Administration menu, go to Low Level Objects: Actions: Report Xml. Open the entry for that report, and change the type from pdf to odt.
Just to make this programming related so it doesn't get shuffled off to superuser.com, here's how to configure the report's XML file with this change. Add the type attribute to your report declaration:
<report
id="report_location_overview_all"
type="odt"
model="stock.location"
name="lot.stock.overview_all"
string="Location Content (With children)"
rml="stock/report/lot_overview_all.rml"/>