scaffold fix, add a sample page and snippet

This commit is contained in:
Antony Lesuisse 2014-06-03 01:00:23 +02:00
parent d9def2c4a7
commit a96fab05b3
3 changed files with 25 additions and 4 deletions

View File

@ -14,8 +14,7 @@ import jinja2
from . import Command
from openerp.modules.module import (get_module_root, MANIFEST,
load_information_from_description_file as load_manifest)
from openerp.modules.module import (get_module_root, MANIFEST, load_information_from_description_file as load_manifest)
class Scaffold(Command):
@ -136,6 +135,8 @@ class ScaffoldModule(object):
self.append_xml_data('theme_xml.jinja2', self.path('views', theme_file), skip_if_exist=True)
def has_import(self, initfile, module):
if not os.path.isfile(initfile):
return False
with open(initfile, 'r') as f:
for imp in ast.parse(f.read()).body:
if isinstance(imp, ast.Import):

View File

@ -19,7 +19,7 @@
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['base'],
'depends': ['base','website'],
'data': [
],

View File

@ -1,6 +1,26 @@
<template id="assets_frontend" inherit_id="website.assets_frontend" name="Theme Zen">
<xpath expr=". position="inside">
<xpath expr="." position="inside">
<link rel="stylesheet" type="text/css" href="/{{ module }}/static/src/css/{{ module }}_theme.css" />
</xpath>
</template>
<template id="website.page_{{ module }}" name="Page {{module}}">
Page {{ module }}
</template>
<template id="{{module}}_snippets" name="{{ module }} Snippet" inherit_id="website.snippets">
<xpath expr="//div[@id='snippet_content']" position="inside">
<div>
<div class="oe_snippet_thumbnail">
<div style="background: white;box-shadow:none;-webkit-box-shadow:none;" class="oe_snippet_thumbnail_img">
<i class="fa fa-file-code-o fa-5x text-muted"></i>
</div>
<span class="oe_snippet_thumbnail_title">{{ module }} Snipper</span>
</div>
<section class="oe_snippet_body mb16 mt16">
<h1>{{ module }} snippet</h1>
</section>
</div>
</xpath>
</template>