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
25 lines
818 B
# coding: utf-8
|
|
# Copyright (C) 2015-Today GRAP (http://www.grap.coop)
|
|
# @author Julien WESTE
|
|
# @author: Sylvain LE GAL (https://twitter.com/legalsylvain)
|
|
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
|
|
from openerp import api, models, fields
|
|
|
|
|
|
class PosMakePayment(models.TransientModel):
|
|
_inherit = 'pos.make.payment'
|
|
|
|
# # Column Section (Overload)
|
|
journal_id = fields.Many2one(
|
|
default=False,
|
|
domain=lambda s: s._domain_journal_id())
|
|
|
|
@api.model
|
|
def _domain_journal_id(self):
|
|
session_obj = self.env['pos.session']
|
|
if self.env.context.get('pos_session_id', False):
|
|
session = session_obj.browse(
|
|
int(self._context.get('pos_session_id')))
|
|
return [('id', 'in', session.journal_ids.ids)]
|
|
return []
|