You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

35 lines
955 B

{% extends "header.template" %}
{% block body %}
from odoo import models, fields
from odoo.tools.translate import _
class {{ unprefix(name) }}(models.Model):
{% if model.state == 'base' %}
_name = "{{ model.model }}"
{% else %}
_inherit = "{{ model.model }}"
{% endif %}
{% if description %}
_description = "{{ description }}"
{% endif %}
{% for field in fields %}
{% for line in wrap(field.notes, replace_whitespace=False) %}
# {{line}}
{% endfor %}
{{ unprefix(field.name) }} = fields.{{ field.ttype|capitalize }}(
string=_("{{ field.field_description }}"),
required={{ field.required }},
translate={{ field.translate }},
readonly={{ field.readonly }}
{% if field.size %}
size={{ field.size }},
{% endif %}
{% if field.helper %}
help=_("{{ field.helper }}"),
{% endif %}
)
{% endfor %}
{% endblock %}