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.

50 lines
1.8 KiB

  1. # Copyright (C) 2017 - Today: GRAP (http://www.grap.coop)
  2. # @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
  3. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  4. from odoo import api, fields, models
  5. class PosConfig(models.Model):
  6. _inherit = "pos.config"
  7. iface_create_sale_order = fields.Boolean(
  8. string="Create Sale Orders",
  9. compute="_compute_iface_create_sale_order",
  10. store=True)
  11. iface_create_draft_sale_order = fields.Boolean(
  12. string="Create Draft Sale Orders",
  13. default=True,
  14. help="If checked, the cashier will have the possibility to create"
  15. " a draft Sale Order, based on the current draft PoS Order.",
  16. )
  17. iface_create_confirmed_sale_order = fields.Boolean(
  18. string="Create Confirmed Sale Orders",
  19. default=True,
  20. help="If checked, the cashier will have the possibility to create"
  21. " a confirmed Sale Order, based on the current draft PoS Order.",
  22. )
  23. iface_create_delivered_sale_order = fields.Boolean(
  24. string="Create Delivered Sale Orders",
  25. default=True,
  26. help="If checked, the cashier will have the possibility to create"
  27. " a confirmed sale Order, based on the current draft PoS Order.\n"
  28. " the according picking will be marked as delivered. Only invoices"
  29. " process will be possible.",
  30. )
  31. @api.depends(
  32. "iface_create_draft_sale_order",
  33. "iface_create_confirmed_sale_order",
  34. "iface_create_delivered_sale_order",
  35. )
  36. def _compute_iface_create_sale_order(self):
  37. for config in self:
  38. config.iface_create_sale_order = any([
  39. config.iface_create_draft_sale_order,
  40. config.iface_create_confirmed_sale_order,
  41. config.iface_create_delivered_sale_order,
  42. ])