Skip to content

Commit

Permalink
[IMP] prototype: better management of special cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jordi Riera committed Dec 30, 2014
1 parent b1d5a55 commit 972d2f2
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion prototype/templates/8.0/__openerp__.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{{ prototype.description }}

* Module exported by the prototype module for version 8.0.
* If you have any questions, please contact Savoir-faire Linux \
* If you have any questions, please contact Savoir-faire Linux
(support@savoirfairelinux.com)
""",

Expand Down
4 changes: 2 additions & 2 deletions prototype/templates/8.0/header.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
##############################################################################
#
# Odoo, Open Source Management Solution
# This module copyright (C) {{ export_year }} {{ author }}
# ({{ website }}).
# This module copyright (C) {{ export_year }} {% if author %}{{ author }}{% endif %}
# {% if website %}({{ website }}).{% endif %}
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
Expand Down
4 changes: 3 additions & 1 deletion prototype/templates/8.0/models/model_name.py.template
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ class {{ name }}(models.Model):
{% if description %}_description = "{{ description }}"{% endif %}

{% for field in fields -%}
{% if field.notes %}# {{ field.notes }}{% endif %}
{{ field.name }} = fields.{{ field.ttype|capitalize }}(
string=_("{{ field.field_description }}"),
required={{ field.required }},
translate={{ field.translate }},
readonly={{ field.readonly }},
help=_('{{ field.notes }}'),
{% if field.size %}size={{ field.size }},{% endif %}
{% if field.helper %}help=_('{{ field.helper }}'),{% endif %}
)
{% endfor %}

Expand Down
2 changes: 1 addition & 1 deletion prototype/templates/8.0/views/model_views.xml.template
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
Be careful, custom field have a x_ prefix that has to be
removed
#}
{{ view.arch|replace('<?xml version="1.0"?>', '')|replace('"x_', '"') }}
{{ view.arch|replace('"', '\'')|replace('<?xml version="1.0"?>', '')|replace('"x_', '"') }}
</field>
</record>
{% endfor %}
Expand Down

0 comments on commit 972d2f2

Please sign in to comment.