OCA reporting engine fork for dev and update.
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.

38 lines
1.5 KiB

  1. from odoo import models, fields
  2. class ReportPaperformatLabel(models.Model):
  3. _name = "report.paperformat.label"
  4. _inherits = {"report.paperformat": "paperformat_id"}
  5. _description = "Label Paper Format"
  6. paperformat_id = fields.Many2one(
  7. "report.paperformat",
  8. string="Paper Format",
  9. required=True,
  10. ondelete="cascade",
  11. )
  12. label_width = fields.Float(
  13. "Label Width (mm)",
  14. default=60,
  15. required=True,
  16. )
  17. label_height = fields.Float(
  18. "Label Height (mm)",
  19. default=42.3,
  20. required=True,
  21. )
  22. label_padding_top = fields.Float("Label Padding Top (mm)", default=2)
  23. label_padding_right = fields.Float("Label Padding Right (mm)", default=2)
  24. label_padding_bottom = fields.Float("Label Padding Bottom (mm)", default=2)
  25. label_padding_left = fields.Float("Label Padding Left (mm)", default=2)
  26. label_margin_top = fields.Float("Label Margin Top (mm)", default=2)
  27. label_margin_right = fields.Float("Label Margin Right (mm)", default=2)
  28. label_margin_bottom = fields.Float("Label Margin Bottom (mm)", default=2)
  29. label_margin_left = fields.Float("Label Margin Left (mm)", default=2)
  30. # Overload inherits defaults
  31. orientation = fields.Selection(inherited=True, default="Portrait")
  32. header_spacing = fields.Integer(inherited=True, default=0)
  33. margin_top = fields.Float(inherited=True, default=7)
  34. margin_bottom = fields.Float(inherited=True, default=7)