When i try to give report_name in report tag it throws below error:
AssertionError: Element odoo has extra content: report, line 7
*.xml
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<report id="action_report_followup"
model="account_followup.followup"
report_name="PPPPPPPPPPpppp" //Here is the problem
string="Follow-up Report"
report_type="qweb-pdf"
name="payment_followup.report_followup"
file="payment_followup.report_followup"
menu="True"/>
</odoo>
If i remove attribute report_name it will work fine, and use value of string as report name. I need to give other name. How can i resolve this issue?
You can try this once.
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<report
string="Follow-up Report"
id="action_report_followup"
model="account_followup.followup"
report_type="qweb-pdf"
name="payment_followup.report_followup"
file="payment_followup.report_followup"
menu="True"/>
</data>
</odoo>
The attribute that you are trying to use here, "report_name", is the culprit. There is no attribute such as "report_name". Use the attribute "name" instead.
See the example below:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<report id="action_report_followup"
model="account_followup.followup"
string="Follow-up Report"
report_type="qweb-pdf"
name="payment_followup.report_followup"
file="payment_followup.report_followup"
menu="True"/>
</odoo>
Related
grails version 3.3.1
cache-ehcache:3.0.0.M1
can somebody send me a valid ehcache.xmlplease?
My file looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<ehcache xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="ehcache.xsd"
updateCheck="true"
monitoring="autodetect"
dynamicConfig="true">
<diskStore path="java.io.tmpdir"/>
<cache name="sevenSeconds"
maxEntriesLocalHeap="100"
maxEntriesLocalDisk="1000"
eternal="false"
timeToLiveSeconds="7"
timeToIdleSeconds="0"
memoryStoreEvictionPolicy="LFU"
transactionalMode="off">
<persistence strategy="localTempSwap" />
</cache>
<defaultCache
maxElementsInMemory="50000"
eternal="false"
timeToIdleSeconds="120"
timeToLiveSeconds="120"
overflowToDisk="true"
diskPersistent="false"
diskExpiryThreadIntervalSeconds="120"
memoryStoreEvictionPolicy="LRU"
/>
</ehcache>
and i get this error while startup:
Caused by: org.ehcache.xml.exceptions.XmlConfigurationException: Error parsing XML configuration at file:/home/user/workspaces/api2-grails/grails-app/conf/ehcacheCustom.xml
Caused by: org.xml.sax.SAXParseException: cvc-elt.1.a: Cannot find the declaration of element 'ehcache'.
thanks for suggestions
Since ehcache 3.0.0 the xml format changed. This is my base version:
<?xml version="1.0" encoding="UTF-8"?>
<config
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns='http://www.ehcache.org/v3'
xsi:schemaLocation="ehcache-core.xsd">
<persistence directory="java.io.tmpdir"/>
<cache alias="twentySeconds">
<expiry>
<ttl unit="seconds">20</ttl>
</expiry>
<heap>2</heap>
</cache>
</config>
After struggling with the same issue I found this link and just took it as a base to get the following working example:
<ehcache:config xmlns:ehcache="http://www.ehcache.org/v3" xmlns:jcache="http://www.ehcache.org/v3/jsr107">
<ehcache:cache alias="books">
<ehcache:key-type>java.lang.String</ehcache:key-type>
<ehcache:value-type>hello.Book</ehcache:value-type>
<ehcache:resources>
<ehcache:heap unit="MB">1</ehcache:heap>
<!--ehcache:offheap unit="MB">10</ehcache:offheap-->
</ehcache:resources>
</ehcache:cache>
</ehcache:config>
I want to write a custom module to replace mail templates.
Those templates are included in base Odoo addons, such as sale:
The sale.order template ìs provided by the file /sale/data/mail_template_data.xml
This template is as follows:
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!--Email template -->
<record id="email_template_edi_sale" model="mail.template">
<field name="name">Sales Order - Send by Email</field>¬
...
</odoo>
As the custom module wants to replace this standard base template:
Can a record with the same id be provided by the custom module to replace this mail template?
What shall be writte in <data noupdate>?
What will happen if module sale is updated?
Odoo 10 community edition.
For replacing the Email Templates just add the addon name in-front of the template name followed by dot(.) and make sure that you delete the default email template from the front end. Then update your custom addon. This will replace the old template.
Example:
<record id="sale.email_template_edi_sale" model="mail.template">
<field name="name">Sales Quotation</field>
<field name="email_from">${(object.user_id.email and '%s <%s>' % (object.user_id.name, object.user_id.email) or '')|safe}</field>
<field name="subject">${object.company_id.name} ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'} (Ref ${object.name or 'n/a' })</field>
<field name="partner_to">${object.partner_invoice_id.id}</field>
....
....
</record>
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="1">
<!--Email template -->
<record id="email_template_edi_sale" model="mail.template">
<field name="name">Sales Order - Send by Email</field>
...
</odoo>
Please add your code to
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<delete model="mail.template" search="
[('id','=',ref('sale.email_template_edi_sale'))]"/>
<!--Email template -->
<record id="sale.email_template_edi_sale" model="mail.template">
<field name="name">Sales Order - Send by Email</field>
...
</odoo>
This will delete the original mail template and add a new template with the same ID so that the odoo functionlity is not disturbed.
Don't delete original template, you will lose the original module field and somethings will stop to work. Instead change noupdate value in ir.model.data for your template.
To do this automatically on module update:
Modify model 'ir.model.data' and add an allow_update method, creating a ir_model_data.py in models folder (modify __init__.py to include new file):
from odoo import models, fields, api
class IrModelData(models.Model):
_inherit = 'ir.model.data'
#api.model
def allow_update(self, module, name, model):
self.search([('module', '=', module), ('name', '=', name), ('model', '=', model)])[0].noupdate = False
Add function call element to allow_update before your record update and pass the original module name, external_id and 'mail.template':
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data noupdate="0">
<function model='ir.model.data' name='allow_update'>
<value>sale</value>
<value>email_template_edi_sale</value>
<value>mail.template</value>
</function>
<record id="sale.email_template_edi_sale" model="mail.template" >
<field name="body_html" type="html">
<div style="margin: 0px; padding: 0px;">
<p style="margin: 0px; padding: 0px; font-size: 13px;">
% set doc_name = 'quotation' if object.state in ('draft', 'sent') else 'order'
Dear ${object.partner_id.name}
i get this WARNNIG when i create my report with jasper reports
'NoneType' object has no attribute 'getitem'
,'NoneType' object has no attribute 'getitem',
import jasper_reports
from openerp import pooler
def jasper_sub_test(cr,uid,ids,data,context=None):
pool=pooler.get_pool(cr,dr)
return{}
jasper_reports.report_jasper('report.decompte_client',
'facturation.attachement',
parser=jasper_sub_test
)
<?xml version="1.0"?>
<openerp>
<data>
<report string="report attachement client"
model="facturation.attachement"
auto="True"
name="decompte_report"
rml="TrvxFacturation/report/report_attach_client.jrxml"
id="report_test"
menu="True"
/>
</data>
My ariba network cannot parse my document cXML response. At ariba screen i have this response
<?xml version="1.0" encoding="UTF-8"?>
<cXML payloadID="1501467044460-2947794417638298020#216.109.111.19" timeStamp="2017-07-30T19:10:44-07:00">
<Response>
<Status code="200" text="OK" />
<PunchOutSetupResponse>
<StartPage>
<URL>test.ariba.com</URL>
</StartPage>
</PunchOutSetupResponse>
</Response>
</cXML>
However I still get this message from Ariba:
Couldn't parse document
Can anyone support me with this.
This is the document we're using and working correctly
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE cXML SYSTEM "http://xml.cxml.org/schemas/cXML/1.2.014/cXML.dtd">
<cXML timestamp="<%= #timestamp %>" payloadID="<%= #payload_id %>">
<Response>
<Status code="200" text="success"></Status>
<PunchOutSetupResponse>
<StartPage>
<URL><%= #start_url %></URL>
</StartPage>
</PunchOutSetupResponse>
</Response>
</cXML>
The start_url must be a valid URL like http://test.mysite.com/xxxxx
could you check if there is language dependency. lang="en-US"
I am attempting to load an XML file through SSIS. I want to note that I did generate the XSD through SSIS. Here is the sample file which I was able to load successfully:
<?xml version="1.0" encoding="UTF-8"?>
<ACOParticipantData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<HeaderCode>HDR_PRVDR</HeaderCode>
<FileCreationDate>20160101</FileCreationDate>
<ACOProgCode>21</ACOProgCode>
</Header>
<Participants>
<Participant>
<ACO_ID>V199</ACO_ID>
<TIN>123456789</TIN>
<Old_TIN>987654321</Old_TIN>
<Org_NPI>1234567890</Org_NPI>
<Ind_NPI>1234567890</Ind_NPI>
<CCN>123456</CCN>
<PRG_Eff_Dt>20160101</PRG_Eff_Dt>
<PRG_Term_Dt>20161231</PRG_Term_Dt>
<ErrorCode>44</ErrorCode>
</Participant>
</Participants>
<Trailer>
<TrailerCode>TRL_PRVDR</TrailerCode>
<FileCreationDate>20160101</FileCreationDate>
<RecordCount>1</RecordCount>
</Trailer>
</ACOParticipantData>
The production file has the same format but I am now receiving the below error in SSIS:
[XML Source [79]] Error: The XML Source was unable to process the XML
data. The Xml source document contains the "xsi:nil" attribute with a
value of true on the "Old_TIN" element, therefore the element must be
empty.
However, there doesn't seem to be anything erroneous about the source file. How would one go about debugging and ingesting this file successfully?
EDIT:
Out of the two production files, I've altered the smaller one slightly but it will look like this:
<?xml version="1.0" encoding="UTF-8"?>
<ACOParticipantData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Header>
<HeaderCode>HDR_PRVDR</HeaderCode>
<FileCreationDate>20160602</FileCreationDate>
<ACOProgCode>21</ACOProgCode>
</Header>
<Participants xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Participant>
<ACO_ID>V130</ACO_ID>
<TIN>123456789</TIN>
<Old_TIN xsi:nil="true">
</Old_TIN>
<Org_NPI xsi:nil="true">
</Org_NPI>
<Ind_NPI>0987654321</Ind_NPI>
<CCN xsi:nil="true">
</CCN>
<PRG_Eff_Dt>20160101</PRG_Eff_Dt>
<PRG_Term_Dt>20160601</PRG_Term_Dt>
<ErrorCode>00</ErrorCode>
</Participant>
<Participant>
<ACO_ID>V130</ACO_ID>
<TIN>111222333</TIN>
<Old_TIN xsi:nil="true">
</Old_TIN>
<Org_NPI xsi:nil="true">
</Org_NPI>
<Ind_NPI>4445556667</Ind_NPI>
<CCN xsi:nil="true">
</CCN>
<PRG_Eff_Dt>20160101</PRG_Eff_Dt>
<PRG_Term_Dt>20160601</PRG_Term_Dt>
<ErrorCode>00</ErrorCode>
</Participant>
</Participants>
<Trailer>
<TrailerCode>TRL_PRVDR</TrailerCode>
<FileCreationDate>20160602</FileCreationDate>
<RecordCount>2</RecordCount>
</Trailer>
</ACOParticipantData>
Search for xsi:nil="true" in your real data XML.
Being empty or being NULL is close but not exactly the same. In some cases this is needed to be distinguished.
If an element is marked as NULL like - in your case probably: <Old_TIN xsi:nil="true"> there should be no value for this element.
If there is the xsi:nil flag and a value it's a contradiction...
UPDATE
According to your edits you find this there (reduced)
<Participant>
<Old_TIN xsi:nil="true">
</Old_TIN>
<Org_NPI xsi:nil="true">
</Org_NPI>
<CCN xsi:nil="true">
</CCN>
</Participant>
These elements are not NULL, they contain a line break and spaces... Try change this to
<Participant>
<Old_TIN xsi:nil="true"/>
<Org_NPI xsi:nil="true"/>
<CCN xsi:nil="true"/>
</Participant>