Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • onchange quantity sequence in account module in OpenERP(Odoo-8)

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 283
    Comment on it

    In OpenERP first, we will manage all file and create module and then inherits to the account.invoice object in your .py file.

    Follow these step given below

    Step1- First, we create custom module like as a test module and put this test module in your server and then install in your database.

    Step2- Then create .py file in your test module and file name like: test.py file and pass test.py file in your __init__.py file. After this writes function and fields here and same in database.

    Using this code given below:

    def onchange_squences(self, cr, uid, ids, qty_char, product  , price_unit=0, discount=0, quantity=0, context=None):
            qty_char = qty_char
            product_obj = self.pool.get('product.product')
            product_obj = product_obj.browse(cr, uid, product, context=context)
            prod_type = product_obj.supp_ref
            squ_meter = product_obj.squ_meter
    
            price = price_unit
            value = {}
            if prod_type == 'T':
                if qty_char:
                    typ = float(qty_char)
                    qty = typ / squ_meter
                    round = math.ceil(qty)
                    new_qty = round * squ_meter
                    value['quantity'] = round
                subtotal = (quantity) * (discount)
                value['price_subtotal'] = subtotal
            elif prod_type == 'B':
                if qty_char:
                    typ = float(qty_char)
                    qty = typ / squ_meter
                    round = math.ceil(qty)
                    new_qty = round * squ_meter
                    value['quantity'] = round
                subtotal = (quantity) * (discount)
                value['price_subtotal'] = subtotal
            else:
                if qty_char:
                    typ= float(qty_char)
                    value['quantity'] = typ
                subtotal = (quantity) * (discount)
                value['price_subtotal'] = subtotal
                
            return {'value': value}
            

 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: