Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to create Picking List when planned date if it is greater than value in OpenERP

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 299
    Comment on it

    To create the picking list of User defined argument and to the calculates planned date if it is greater than value and than if condition is true and its also user defined argument so you have to validate the Name of field and also Value of field and return the true condition and in stock_picking also calculate to the maximum date and check if condition is true and validate in stock_picking. Use this funciton show in given below

    def maximum_date(self, cr, uid, ids, name, value, arg, context=None):
      
            if not value:
                return False
            if isinstance(ids, (int, long)):
                ids = [ids]
            for pick in self.browse(cr, uid, ids, context=context):
                sql_str = """update stock_move set
                        date='%s'
                    where
                        picking_id=%d """ % (value, pick.id)
    
                if pick.max_date:
                    sql_str += " and (date='" + pick.max_date + "' or date>'" + value + "')"
                cr.execute(sql_str)
            return True

     

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
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: