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.

44 lines
1.6 KiB

  1. # Copyright 2021 Le Filament (<http://www.le-filament.com>)
  2. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  3. from odoo import fields, models, api
  4. class PosOrder(models.Model):
  5. _inherit = 'pos.order'
  6. # ------------------------------------------------------
  7. # Fields declaration
  8. # ------------------------------------------------------
  9. # ------------------------------------------------------
  10. # SQL Constraints
  11. # ------------------------------------------------------
  12. # ------------------------------------------------------
  13. # Default methods
  14. # ------------------------------------------------------
  15. # ------------------------------------------------------
  16. # Computed fields / Search Fields
  17. # ------------------------------------------------------
  18. # ------------------------------------------------------
  19. # Onchange / Constraints
  20. # ------------------------------------------------------
  21. # ------------------------------------------------------
  22. # CRUD methods (ORM overrides)
  23. # ------------------------------------------------------
  24. def test_paid(self):
  25. for order in self:
  26. if order.config_id.is_balance_free:
  27. return True
  28. return super(PosOrder, self).test_paid()
  29. # ------------------------------------------------------
  30. # Actions
  31. # ------------------------------------------------------
  32. # ------------------------------------------------------
  33. # Business methods
  34. # ------------------------------------------------------