I installed OpenERP 7 in Cent OS Final 6.4 and Python 2.6.6 i=with static ip
I accessed from an outside network using internet it works well
But i accessed within the network it throws an error
Uncaught Error: QWeb2: Template 'WebClient' not found
now i use version is odoo 9.0 and ubuntu 15.10 and python 2.7.10
i also meet this issue. And release issue with later.
use
ajax.loadXML('/web_editor/static/src/xml/snippets.xml', qweb);
to load this xml files,and sinppets.xml maybe like this
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-name="web_editor.snippets">
<div id='oe_snippets' class="hidden-xs o_open">
<div id="o_arrow">
<span class="fa fa-angle-double-right fa-1x" style="top: 10px;">
</span>
<div>Insert Blocks</div>
<span class="fa fa-angle-double-right fa-1x" style="bottom: 10px;">
</span>
</div>
<div id="o_left_bar">
<span class='snippets_loading'>Snippets are loading...
</span>
</div>
</div>
</t>
</templates>
var ajax = require('web.ajax');
var core = require('web.core');
var Widget = require('web.Widget');
var qweb = core.qweb;
ajax.loadXML('/web_editor/static/src/xml/snippets.xml', qweb);
var BuildingBlock = Widget.extend({
template: 'web_editor.snippets',
init: function (parent, $editable) {
this._super.apply(this, arguments);
},
start: function() {....
}
});
and now, none issue.
good luck~
Related
I am trying to create a client action widget, but getting an error when I click the menu item.
Here is the error.
Traceback:
Error: widget.getTitle is not a function
_executeClientAction#http://localhost:5014/web/static/src/js/chrome/action_manager.js:449:27
_handleAction#http://localhost:5014/web/static/src/js/chrome/action_manager.js:670:29
*.js
odoo.define('mobile_basket_verification.BasketVerification', function (require){
'use strict';
var core = require('web.core');
var Widget = require('web.Widget');
// var ClientAction = require('stock_barcode.ClientAction');
// var ViewsWidget = require('stock_barcode.ViewsWidget');
var Qweb = core.qweb;
var _t = core._t;
var BasketWidget = Widget.extend({
// template:'BasketVerificationComponent',
contentTemplate:'BasketVerificationComponent',
init: function(parent,action){
this._super.apply(this, arguments);
},
start: function() {
this._super.apply(this, arguments);
console.log('Widget Start')
},
});
core.action_registry.add('basket_verification_client_action',BasketWidget);
return BasketWidget;
});
*static.xml
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="mobile_basket_verification.BasketVerificationComponent">
<div class="o_barcode_message d-flex flex-column justify-content-center align-items-center bg-800">
<div class="o_barcode_pic position-relative text-center mt-2 mb-1">
<i class="fa fa-5x mx-auto fa-exclamation-triangle text-white d-none"/>
<img class="o_barcode_icon" src="/stock_barcode/static/img/barcode.svg" alt="Barcode" height="40px"/>
</div>
<div class="basket_barcode d-flex" style="float:right;width:400px;margin-right:200px;">
<span>Basket </span>
<input type="text" class="o_field_char basket_barcode_input" style="width:100px"/>
<button class="btn btn-primary verify_basket">Add</button>
</div>
</div>
<div class="o_barcode_lines_header alert mb-0"></div>
<div class="o_barcode_lines list-group flex-grow-1 d-block position-relative"></div>
</t>
</templates>
*.Menuitem
<menuitem id="basket_verification_client_action_menu" name="Basket Verification11" parent=""
action="basket_verification_client_action"/>
clientaction.
<odoo>
<record id="basket_verification_client_action" model="ir.actions.client">
<field name="name">Basket Verification Client Action</field>
<field name="tag">basket_verification_client_action</field>
</record>
</odoo>
Please help me to resolve this error.
Extend the AbstractAction instead.
var BasketWidget = AbstractAction.extend({
});
Check the Client actions documentation:
from the perspective of the web client, it is a widget, which inherit from the class AbstractAction, and is supposed to be registered in the action registry under the corresponding key (from the field char)
github code: https://github.com/aurora10/amazone-clone.git
I try to utilize Axios to hit an API but get an error:
The error in console is NUXT SSR:
TypeError: Cannot read property '$get' of undefined
at asyncData (pages/index.js:98:35)
at promisify (server.js:1898:15)
at Promise.all.Components.map.Component (server.js:1573:82)
at Array.map (<anonymous>)
at module.exports../.nuxt/server.js.__webpack_exports__.default (server.js:1569:51)
This is how I try to do it:
export default {
async asyncData({ $axios }) {
try {
let response = await $axios.$get("http://localhost:3000/api/products");
console.log(response);
return {
products: response.products
};
}catch (err) {
console.log(err);
}
}
}
The API itself works. If I call it from browser - it gives me the list of products.
What am I doing wrong?
Complete fille:
<template>
<div class="container-fluid browsing-history">
<div class="row">
<div class="col-sm-8 col-8">
<h1 class="a-size-large a-spacing-none a-text-normal">All products</h1>
<div class="a-spacing-large"></div>
Add new product
Add new category
Add new owner
</div>
</div>
</div>
<div class="a-spacing-large"></div>
<div class="container-fluid browsing-history">
<div class="row">
<div class="col-xl-2 col-lg-2 col-md-3 col-sm-6 col-6 br bb">
<div class="history-box">
<!-- product page-->
<a href="#" class="a-link-normal">
<img src="" class="img-fluid" alt="">
</a>
<div class="a-spacing-top-base asin-title">
<span class="a-text-normal">
<div class="p13n-sc-truncated">Title </div>
</span>
</div>
<div class="a-row">
<a href="#">
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
<i class="fas fa-star"></i>
</a>
<span class="a-letter-space"></span>
<span class="a-color-tertiary a-size-small asin-reviews">(1732)</span>
</div>
</div>
<!--price-->
<div class="a-row">
<span class="p13-sc-price">$25</span>
</div>
<!--byttons-->
<div class="a-row">
Update
Delete
</div>
</div>
</div>
</div>
export default {
async asyncData({$axios}) {
try {
let response = await $axios.$get("http://localhost:3000/api/products");
console.log(response);
return {
products: products
};
} catch (err) {
console.log(err);
}
}
};
I did make sure it is installed. I had also included
module.exports = {
modules: [
'#nuxtjs/axios',
],
axios: {
// proxyHeaders: false
}
}
just like they tell in the the installation manual. Also tried to remove $ before get...still the same error in console:( I have no clue what else could be wrong..
It looks like you are not including the axios module, look at the installation process here https://axios.nuxtjs.org/setup.html#install
Your config should then look like this in your export default
/*
** Nuxt.js modules
*/
modules: [
// Doc: https://bootstrap-vue.js.org
'bootstrap-vue/nuxt',
'#nuxtjs/axios'
],
axios: {
// proxyHeaders: false
}
Here are the steps for axios in Nuxt
Make sure axios is installed npm install #nuxtjs/axios
Add axios in nuxt.config.js
...
axios: {
// proxyHeaders: false
}
...
You don't need the $ in $axios.$get. It should be $axios.get()
I always get error "M is not defined" el is not defined
codepen sample
if you open console, you will see the error
I first load jquery.min.js then load materialize.min.js .css
then load my script.js below.
M is not recognized, which it should
why?
// init materialize tab
var instance = M.Tabs.init(el, options);
// Or with jQuery
$(document).ready(function(){
$('.tabs').tabs();
});
This is html
<div class="row">
<div class="col s12">
<ul class="tabs">
<li class="tab col s3">Test 1</li>
<li class="tab col s3"><a class="active" href="#test2">Test 2</a></li>
<li class="tab col s3 disabled">Disabled Tab</li>
<li class="tab col s3">Test 4</li>
</ul>
</div>
<div id="test1" class="col s12">Test 1</div>
<div id="test2" class="col s12">Test 2</div>
<div id="test3" class="col s12">Test 3</div>
<div id="test4" class="col s12">Test 4</div>
</div>
I found the problem, it is version.
Make sure you use version => 1.0.0.
https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/js/materialize.min.js
If you use version <1.0.0 very likely you have error as 'M is not defined'
Make sure you load jquery before materialize css !
Also you must first define elem and options to init tab
// init materialize tab
var elem = $('.tabs')
var options = {}
var instance = M.Tabs.init(elem, options);
//or Without Jquery
//var elem = document.querySelector('.tabs');
var options = {}
var instance = M.Tabs.init(elem, options);
I am developing an application using angularjs and visualforce remote calling.
The application works right in all the browser except in Safari. When the application is run on Safari browser it is not able to communicate to the server
returning
"Unable to connect to server( Communication failed)".
Code snippet
Apex Controller
global class UsaTAevaluationCtrl{
#RemoteAction
public static string getkeyvalue(string username,string key)
{
string interviewInviteId1;
system.debug(username+'OOOOOOOOOO'+key);
interviewInviteId1='False';
Tech_Screen_Invites__c t=new Tech_Screen_Invites__c();
try
{
t=[select id,name from Tech_Screen_Invites__c where Name=:username];
string recordkey=t.id;
if(t.id!=null)
{
interviewInviteId1=t.id;
recordkey=string.valueof(t.id);
if(recordkey.length()==18)
recordkey=recordkey.left(15);
if(recordkey.right(3)==key)
interviewInviteId1=t.id;
}
else
{}
}catch(exception e){}
return interviewInviteId1;
}
}
Visualforce page
<apex:page controller="UsaTAevaluationCtrl" showHeader="false" standardStylesheets="false" docType="html-5.0">
<apex:form >
// include statements
....
<script>
var services = (function(){
return function (userName, password) {
var deferred = $.Deferred();
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.UsaTAevaluationCtrl.getkeyvalue}',
userName,
password,
function (result, event){
console.log("Result -> ", result);
});
return deferred.promise();
}
})()
</script>
....
<div class="container" ng-app="TechEval" ng-controller="evalform" ng-init="initEvent()">
<div class="row evaluation-row">
<div class="col-md-12 col-xs-12"> </div>
</div>
<div class="row evaluation-row" ng-show="isAuthenticationSuccess">
<div class="col-md-12 col-xs-12 alert alert-danger score-alert">Invalid Credentials</div>
</div>
<div class="row evaluation-row">
<div class="col-md-3 col-xs-12">
<h1 class="skill-title">User Name</h1>
</div>
<div class="col-md-9 col-xs-12">
<div class="skill-new">
<input name='_username' id='userinput' ng-model='_username' required="required"></input>
</div>
</div>
</div>
<div class="row evaluation-row">
<div class="col-md-12 col-xs-12"></div>
</div>
<div class="row evaluation-row">
<div class="col-md-3 col-xs-12">
<h1 class="skill-title">Token</h1>
</div>
<div class="col-md-9 col-xs-12">
<div class="skill-new">
<input name="_password" id="passvalue" type="password" ng-model='_password' required="required"></input>
</div>
</div>
</div>
<div class="row btn-row">
<div class="col-md-3 col-xs-12"> </div>
<div class="col-md-9 col-xs-12">
<div class="skill-new">
<button class="btn btn-primary" style="margin-left:92px;" ng-click="Authentication()">Submit</button>
</div>
</div>
</div>
</div>
</apex:form>
</apex:page>
Code in Angular Controller
var EvalApp = angular.module('TechEval', ['ui.bootstrap']);
EvalApp.controller('evalform', function ($scope, $log, $q) {
$scope.Authentication = function () {
services.getKeyValue($scope._username,
$scope._password,
function (result, event){
console.log("Result -> ", result);
});
}
}
Functionality
When user enter username and password and hits submit button the remote service is to be called.
If you check Supported Browsers for Salesforce Classic page, you find:
Apple Safari versions 8.x on Mac OS X There are no configuration
recommendations for Safari. Apple Safari on iOS isn’t supported for
the full Salesforce site. Safari isn’t supported for:
The Salesforce console
Salesforce CRM Call Center built with CTI Toolkit versions below 4.0
Salesforce Wave Analytics
Are you sure that your OS/Safari version are compatible with it?
I am using angularJs, twitter bootstrap with asp.net mvc4. I didn't use angular-strap. I am trying to load a partial view in bootstrap modal. The partial view contains angular code.
Here is my code where I am calling the bootstrap modal:
#model IEnumerable<IMS.Domain.Model.GetAllRequisitions_Result>
#{
ViewBag.Title = "Requisition List";
Layout = "~/Views/Shared/MasterPage.cshtml";
}
Launch demo modal
<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-body">
</div>
</div>
<script type="text/javascript">
function loadCreateForm() {
var content = '#Url.Action("Create", "Requisition", new { area = "IMS" })';
$('div.modal-body').load(content);
}
</script>
Here is my code for 'Create' action of 'Requisition' controller:
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 id="myModalLabel">Modal header</h3>
</div>
<div ng-app="">
<label>Sample: <input type="text" ng-model="sample" /></label>
<br />
<label>Show Value: {{sample}}</label>
</div>
<div class="ContainerRowButton">
<button class="btn" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
For ng-model="sample" when I am trying to show data by {{sample}} it stays {{sample}}. It's like my 'Create' action is not getting angularJs.
I've rendered all necessary scrips in the 'MasterPage.cshtml'. My MasterPage.cshtml contains:
#Scripts.Render("~/bundles/jquery")
#Scripts.Render("~/bundles/jqueryui")
#Scripts.Render("~/bundles/others")
And here is the code of my 'Bundle.config.cs' file:
bundles.Add(new ScriptBundle("~/bundles/jquery").Include(
"~/Scripts/jquery-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/jqueryui").Include(
"~/Scripts/jquery-ui-{version}.js"));
bundles.Add(new ScriptBundle("~/bundles/others").Include(
"~/Content/bootstrap/js/bootstrap.js",
"~/Scripts/jquery.dataTables.js",
"~/Scripts/dataTables_bootstrap.js",
"~/Scripts/bootstrap-dropdown.js",
"~/Scripts/jquery.dataTables.columnFilter.js",
"~/Scripts/Custom/CustomScript.js",
"~/Scripts/jquery.validationEngine-en.js",
"~/Scripts/jquery.validationEngine.js",
"~/Scripts/angular.js"
));
What wrong am I doing? Need help ...
Adding to what #Muctadir said, you need to tell angular to check your modal partial for angular elements. You do that by calling $compile before injecting the partial into the DOM. The problem is that you have to be able to get access to the $compile service and you can't do that inside of your loadCreateForm(), you can only do that from an angular module. So, you need to organize your code in such a way that you can get what you need. Here's my suggestion:
Create a directive to handle your modal and its contents:
.directive('myModal', function($compile){
return {
replace:false,
link: function(scope, element, attrs){
var content = '#Url.Action("Create", "Requisition", new { area = "IMS" })';
elem.load(content, null, function(){
$compile(elem.contents())(scope);
});
}
};
});
That will load the content and then compile the contents using the current scope, but only after the content has been loaded from the server. Hope that helps.