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.

24 lines
752 B

  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 AccountJournal(models.Model):
  6. _inherit = "account.journal"
  7. pos_control = fields.Boolean(
  8. string="POS Journal Control",
  9. help="If you want this journal"
  10. " to be controled at closing of point of sale, check this option",
  11. default=False
  12. )
  13. @api.onchange("type")
  14. def onchange_type(self):
  15. for journal in self:
  16. if journal.type in ["bank", "cash"]:
  17. journal.pos_control = True
  18. else:
  19. journal.pos_control = False