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.

43 lines
1.7 KiB

  1. # -*- encoding: utf-8 -*-
  2. ##############################################################################
  3. #
  4. # Point Of Sale - Change Payment module for Odoo
  5. # Copyright (C) 2015-Today GRAP (http://www.grap.coop)
  6. # @author Sylvain LE GAL (https://twitter.com/legalsylvain)
  7. #
  8. # This program is free software: you can redistribute it and/or modify
  9. # it under the terms of the GNU Affero General Public License as
  10. # published by the Free Software Foundation, either version 3 of the
  11. # License, or (at your option) any later version.
  12. #
  13. # This program is distributed in the hope that it will be useful,
  14. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. # GNU Affero General Public License for more details.
  17. #
  18. # You should have received a copy of the GNU Affero General Public License
  19. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  20. #
  21. ##############################################################################
  22. from openerp.osv import fields
  23. from openerp.osv.orm import TransientModel
  24. class pos_change_payments_wizard_line(TransientModel):
  25. _name = 'pos.change.payments.wizard.line'
  26. # Selection Section
  27. def _select_journals(self, cr, uid, context=None):
  28. aj_obj = self.pool['account.journal']
  29. return aj_obj._get_pos_journal_selection(cr, uid, context=context)
  30. # Column Section
  31. _columns = {
  32. 'wizard_id': fields.many2one(
  33. 'pos.change.payments.wizard', 'Wizard Ref', ondelete='cascade'),
  34. 'journal_id': fields.selection(
  35. _select_journals, 'Journal', required=True),
  36. 'amount': fields.float(
  37. 'Amount'),
  38. }