odoo-8 Template 'report.layout' not found - odoo-8

I can't print no reports anymore with odoo 8.
As it seems, the error is in the database because a newly created database doesn't have this problem.
But how can I correct this in the current database?
File "/opt/odoo8/server/openerp/addons/base/ir/ir_qweb.py", line 200, in get_template
raise QWebTemplateNotFound("Template %r not found" % name, template=origin_template)
QWebTemplateNotFound: Template 'report.layout' not found
Thanks for helping...

You probably have mistakenly butchered either web.layout or report.layout records. In your database that works. Go to Settings -> User Interface -> Views and search for layout. Select report.layout and make note of the configuration and values. Export it or copy it to your broken database. Your broken database may be missing this record entirely. This is a base view so unless you have modified it a vanilla record should work. The important part is the external id as without it you will probable still get this error.

Related

Kentico 9 - Data cache Macro

I'm doing the field validation on the custom table.
This is the macro on the validation field:
{%
foreach (i IN CMSContext.Current.GlobalObjects.CustomTables["customtable"].Items.ItemsAsFields.IdNumber)
{
if (i == IdNumber.Value){
return false;
}
}
return true;
#%}
The issue start from this part of the macro :
CMSContext.Current.GlobalObjects.CustomTables["customtable"].Items.ItemsAsFields.IdNumber
This line of macro should get all the data entered in my customtable, however it didn't get recent ones.
In this case my validation won't work and I will keep entering the same IdNumber.
This is the way how I found out, when I ran this macro via System - Macro - Benchmark :
{%CMSContext.Current.CMSContext.Current.CMSContext.Current.GlobalObjects.CustomTables["customtable"].Items.ItemsAsFields.ItemID #%}
I tested "Clear Cache", this worked. So it seems to me cache issue.
So I have turned off all of the cache in Setting - System - Performance:
Server content caching
Server file caching
Client caching
Output caching
and yet, that line of macro not returning the latest data when I entered new data.
Is there any way to clear cache using macro or other option to solve this problem?
I think this is the cause of your issue (hotfix 9.0.46):
Custom tables - Custom table Items collection incorrectly cached in macros
When using the Items property of custom table objects in macros, the data was incorrectly cached. For example, when using the 'GlobalObjects.CustomTables["<customtablecodename>"].Items' macro, the latest data was not returned.
Neither the output nor the data cache is applied on macros (you can optionally manually turn it on but it's off by default).
There is an extra level of caching which is not visible to the user - the API-level hashtables. Kentico takes care of updating the tables automatically whenever an object is changed via the API. So there are basically two options of what can go wrong:
- either there is a bug in the hashtables
- or you're not updating the custom table via the API but e.g. via a direct SQL query and the system is unaware of changes made to the database
The question is: Are you using a SQL query?
If you are, you have to flush the cache manually by calling ClearHashtables.

CS-Cart Create 2nd Invoice Template

I'm trying to create a second invoice template and add another print invoice link so I can print a standard invoice but also print a 'internal' invoice copy with an 'Official Use' table in which can be filled out by staff on the print out.
I've found the template invoice.tpl and print_invoice.tpl in /basic/mail/orders/
created two new files called invoice.dirty.tpl and print_invoice_dirty.tpl and pasted the content of the original files in the new ones, changed the path and added the table I wanted.
I've managed to locate the code for the 'Print Invoice' link and duplicated that changing the href by adding _dirty to the original 'orders.print_invoice?' but when I try the link it opens the popup ok but I get a 404 error, i've checked the permissions and changed them to full but still it won't play ball...
it seemed quite simple and I expected it to work but obviously i'm missing something, any guidance would be appreciated.
Check controllers that bring data to this files, maybe there is the main problem.
What cs-cart version are you using?
You need to create also the mode > invoice_dirty and this can be added with the help of file order.post.php but before i can give you some instructions i need to know you cs-cart version

CSV insert to database

This is not working as we discussed previously, for some reason and I have done is create some $vars for the uploaded file.
Code available here (Pastebin).
But never actually inserts anything
When doing a var_dump($csv_row) i get: bool(false)
var_dump($fh) shows: resource(89) of type (stream)
var_dump($insert_str) shows all 1700 records from the csv file (obviously too big to post on here)
So I’m guessing the while statement or the whole from if statement is wrong somewhere. Really really would appreciate some help on this, I need to get it working by tomorrow (monday)
You seem to be using the codeigniter database library wrong. I can see a
$this->db->set($insert_str);
but no $this->db->insert() to be found. The set() method only useful with an update() or insert() following it, See the docs, search for $this->db->set().
You either want to use the $this->db->insert_batch() (on the same doc page, unfortunately no direct links for sections) form and build up an array of arrays with your records (so you won't have to create a long sql string either).
Or you can use the $this->db->query() and just feed the $insert_str to it where you now call $this->db->set().
According to your question:
var_dump($insert_str) shows all 1700 records from the csv file
So i would rule out the possibility of the while loop or the if not working.
Put this code at the top of the controller or before reading csv file
ini_set('auto_detect_line_endings', true);
Check if this will work for you

Doctrine record unknown exception in a Symfony 1.4 backend admin module

I am facing a problem with the admin generator and I am unable to get my way around this after 3 hours of brainstorming and exploring.
The error reads as:
500 | Internal Server Error | Doctrine_Record_UnknownPropertyException
Unknown record property / related component "option1" on "Questions"
Looking up the WWW, I got a gist of possible alternatives. None of which seem like the answer. option1, does exist under Questions schema. However, it is option_1 so I am not sure why it says option1. More importantly, opening up BaseQuestions.class.php file, it clearly states:
getOption1() retrieves the value of option_1.
Anybody with any answer on this?
Thanks,
I had just the same problem with a field named address_2. Changing the name of the field in the database to address2 solved the problem. I think that that this is because of the number that confuse the admin generator to translate the name from underscore-separated propriety name to camelCase function name. This issue append only with the admin generator so, if you need to use it you have to change the field name in your DB with option1.

JBO-25002: What is the reason for this error?

I was running my project and was checking recently modified module. On click of the Menu tab it was giving me "java.lang.UnsupportedOperationException" and when I checked in the log I could find the following description:
JBO-25002: Definition com.project.view.pageDefs.pages_per_SearchPageDef
of type Form Binding Definition not found
oracle.jbo.NoDefException: JBO-25002: Definition com.project.view.pageDefs.pages_per_SearchPageDef
of type Form Binding Definition not found
What could be the problem?
You say you were checking "recently modified module". What modification did you make? Was it something which invalidated the business component definition? The documentation says this about JBO-25002:
"Provide a correct name for the business component definition. If the
definition is not in the classpath, you must include it there. Names
are of the format
myProjectPackage.BusinessPackage.BusinessComponent. This error can
also occur if there is a case conflict, as when the database expects
"DEPTNO" and receives "Deptno" instead."
I got this error after changing a query in my View Object. The change removed 3 columns but in the PageDef file the tree binding retained the old column names. I manually removed those column names to fix the problem.

Resources