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

  1. {% extends "header.template" %}
  2. {% block body %}
  3. from odoo import models, fields
  4. from odoo.tools.translate import _
  5. class {{ unprefix(name) }}(models.Model):
  6. {% if model.state == 'base' %}
  7. _name = "{{ model.model }}"
  8. {% else %}
  9. _inherit = "{{ model.model }}"
  10. {% endif %}
  11. {% if description %}
  12. _description = "{{ description }}"
  13. {% endif %}
  14. {% for field in fields %}
  15. {% for line in wrap(field.notes, replace_whitespace=False) %}
  16. # {{line}}
  17. {% endfor %}
  18. {{ unprefix(field.name) }} = fields.{{ field.ttype|capitalize }}(
  19. string=_("{{ field.field_description }}"),
  20. required={{ field.required }},
  21. translate={{ field.translate }},
  22. readonly={{ field.readonly }}
  23. {% if field.size %}
  24. size={{ field.size }},
  25. {% endif %}
  26. {% if field.helper %}
  27. help=_("{{ field.helper }}"),
  28. {% endif %}
  29. )
  30. {% endfor %}
  31. {% endblock %}