Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to create membership IDs in OpenERP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 411
    Comment on it

    In OpenERP first we create the form and browse the record of  account invoice line and then select to the product in product form and then find to the the current user’s ID for security checks. In account invoice line we check to the list of membership line IDs and fields name  and  standard dictionary for contextual values and also  dictionary of state Value.

    use this function show in given below

    def members(self, cr, uid, ids, name, args, context=None):
        res = {}
        inv_obj = self.pool.get('account.invoice')
        for line in self.browse(cr, uid, ids, context=context):
          SELECT i.state, FROM
          account_invoice i
 = (
            SELECT l.invoice_id FROM
            account_invoice_line l WHERE
   = (
              SELECT ml.account_invoice_line FROM
              membership_membership_line ml WHERE
     = %s
          ''', (,))
          fetched = cr.fetchone()
          if not fetched:
            res[] = 'canceled'
          istate = fetched[0]
          state = 'none'
          if (istate == 'draft') | (istate == 'proforma'):
            state = 'waiting'
          elif istate == 'open':
            state = 'invoiced'
          elif istate == 'paid':
            state = 'paid'
            inv = inv_obj.browse(cr, uid, fetched[1], context=context)
            for payment in inv.payment_ids:
              if payment.invoice and payment.invoice.type == 'out_refund':
                state = 'canceled'
          elif istate == 'cancel':
            state = 'canceled'
          res[] = state
        return res


 0 Comment(s)

Sign In

Sign up using

Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: