I took the oepetstore code from github and modified it to suit odoo10 however it is giving me error as Could not find client action 'petstore.homepage'
. In the manifest file I have included all the xml files. code mentioned in github works for odoo9 but not for 10.
petstore.js,
odoo.define('oepetstore.petstore', function (require) {
"use strict";
var Class = require('web.Class');
var Widget = require('web.Widget');
var core = require('web.core');
var utils = require('web.utils');
var _t = core._t;
var _lt = core._lt;
var homePage = Widget.extend({
init: function(parent) {
this._super(parent);
console.log("Hello JS, I'm inside of init.");
},
start: function() {
console.log("Your pet store home page loaded");
},
});
core.view_registry.add('petstore', homePage);
});
petstore.xml,
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<template id="assets_backend" name="petstore_assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<link rel="stylesheet" href="/oepetstore/static/src/css/petstore.css"/>
<script type="text/javascript" src="/oepetstore/static/src/js/petstore.js"/>
</xpath>
</template>
<menuitem id="main_petstore_menu" name="Pet Store" />
<menuitem id="petstore_menu" name="Pet Store"
parent="main_petstore_menu" />
<record id="action_home_page" model="ir.actions.client">
<field name="name">petstore</field>
<field name="tag">petstore</field>
</record>
<menuitem id="home_page_petstore_menu" name="Home Page" parent="petstore_menu"
action="action_home_page"/>
</data>
</odoo>