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.

19 lines
584 B

  1. # -*- coding: utf-8 -*-
  2. # This file is part of OpenERP. The COPYRIGHT file at the top level of
  3. # this module contains the full copyright notices and license terms.
  4. from openerp import models, api
  5. class POSOrder(models.Model):
  6. _inherit = "pos.order"
  7. @api.model
  8. def add_payment(self, order_id, data):
  9. journal_id = data.get('journal')
  10. if journal_id:
  11. journal = self.env['account.journal'].browse(journal_id)
  12. if journal.no_bank_statement:
  13. return None
  14. return super(POSOrder, self).add_payment(order_id, data)