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.

21 lines
683 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.v7
  8. def add_payment(self, cr, uid, order_id, data, context=None):
  9. journal_id = data.get('journal')
  10. if journal_id:
  11. journal_rec = self.pool.get('account.journal').browse(
  12. cr, uid, journal_id, context)
  13. if journal_rec.no_bank_statement:
  14. return None
  15. return super(POSOrder, self).add_payment(
  16. cr, uid, order_id, data, context)