Browse Source

[IMP] Rewrite add_payment function for v8 API

pull/24/head
Andrius Preimantas 10 years ago
parent
commit
4e9875d193
  1. 12
      pos_no_bank_statement/model/point_of_sale.py

12
pos_no_bank_statement/model/point_of_sale.py

@ -8,14 +8,12 @@ from openerp import models, api
class POSOrder(models.Model):
_inherit = "pos.order"
@api.v7
def add_payment(self, cr, uid, order_id, data, context=None):
@api.model
def add_payment(self, order_id, data):
journal_id = data.get('journal')
if journal_id:
journal_rec = self.pool.get('account.journal').browse(
cr, uid, journal_id, context)
if journal_rec.no_bank_statement:
journal = self.env['account.journal'].browse(journal_id)
if journal.no_bank_statement:
return None
return super(POSOrder, self).add_payment(
cr, uid, order_id, data, context)
return super(POSOrder, self).add_payment(order_id, data)
Loading…
Cancel
Save