- print("DEV: [pos_membership] [membership_line] [_state]: name=%s data=%s args=%s context=%s" % (str(name), str(data), str(args), str(context)))
- if type(data) == type(list()) or data.get('class') == 'account.invoice':
- inv_obj = self.pool.get('account.invoice')
- if type(data) == type(list()):
- ids = data
- else:
- ids = data.get('ids')
- for line in self.browse(cr, uid, ids, context=context):
- cr.execute('''
- SELECT i.state, i.id FROM
- account_invoice i
- WHERE
- i.id = (
- SELECT l.invoice_id FROM
- account_invoice_line l WHERE
- l.id = (
- SELECT ml.account_invoice_line FROM
- membership_membership_line ml WHERE
- ml.id = %s
- )
+ print("DEV: [pos_membership] [membership_line] [_state]: name=%s ids=%s args=%s context=%s" % (str(name), str(ids), str(args), str(context)))
+ inv_obj = self.pool.get('account.invoice')
+ ord_obj = self.pool.get('pos.order')
+ for line in self.browse(cr, uid, ids, context=context):
+ cr.execute('''
+ SELECT i.state, i.id FROM
+ account_invoice i
+ WHERE
+ i.id = (
+ SELECT l.invoice_id FROM
+ account_invoice_line l WHERE
+ l.id = (
+ SELECT ml.account_invoice_line FROM
+ membership_membership_line ml WHERE
+ ml.id = %s