Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
c5129fcf
Commit
c5129fcf
authored
10 years ago
by
Fabien Meghazi
Browse files
Options
Downloads
Patches
Plain Diff
Add __init__.py when createing module. Also add templates.xml in
manifest
parent
1261a3ce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
openerp/cli/scaffold.py
+4
-2
4 additions, 2 deletions
openerp/cli/scaffold.py
with
4 additions
and
2 deletions
openerp/cli/scaffold.py
+
4
−
2
View file @
c5129fcf
...
...
@@ -89,6 +89,8 @@ class ScaffoldModule(object):
if
self
.
created
:
manifest_base
=
os
.
path
.
splitext
(
MANIFEST
)[
0
]
self
.
render_file
(
'
%s.jinja2
'
%
manifest_base
,
self
.
path
(
'
%s.py
'
%
manifest_base
))
# Create an empty __init__.py so the module can be imported
open
(
self
.
path
(
'
__init__.py
'
),
'
a
'
).
close
()
def
add_model
(
self
,
model
):
model_module
=
snake
(
model
)
...
...
@@ -131,8 +133,8 @@ class ScaffoldModule(object):
self
.
append_manifest_list
(
'
depends
'
,
'
website
'
)
css_file
=
'
%s_theme.css
'
%
self
.
module
self
.
render_file
(
'
theme_css.jinja2
'
,
self
.
path
(
'
static
'
,
'
src
'
,
'
css
'
,
css_file
))
theme_file
=
'
%s_theme.xml
'
%
self
.
module
self
.
append_
xml_data
(
'
theme_xml.jinja2
'
,
self
.
path
(
'
views
'
,
theme_file
),
skip_if_exist
=
True
)
self
.
append_xml_data
(
'
theme_xml.jinja2
'
,
self
.
path
(
'
views
'
,
'
templates.xml
'
),
skip_if_exist
=
True
)
self
.
append_
manifest_list
(
'
data
'
,
'
views/templates.xml
'
)
def
has_import
(
self
,
initfile
,
module
):
if
not
os
.
path
.
isfile
(
initfile
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment