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.

25 lines
818 B

  1. # coding: utf-8
  2. # Copyright (C) 2015-Today GRAP (http://www.grap.coop)
  3. # @author Julien WESTE
  4. # @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
  5. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
  6. from openerp import api, models, fields
  7. class PosMakePayment(models.TransientModel):
  8. _inherit = 'pos.make.payment'
  9. # # Column Section (Overload)
  10. journal_id = fields.Many2one(
  11. default=False,
  12. domain=lambda s: s._domain_journal_id())
  13. @api.model
  14. def _domain_journal_id(self):
  15. session_obj = self.env['pos.session']
  16. if self.env.context.get('pos_session_id', False):
  17. session = session_obj.browse(
  18. int(self._context.get('pos_session_id')))
  19. return [('id', 'in', session.journal_ids.ids)]
  20. return []