Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
  • How to change product id in your account module in OpenERP(Odoo-8)?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 1.02k
    Comment on it

    In OpenERP, create a custom module like: demo and then create file like: file in your demo module and file pass in your other file file. And then create other file demo.xml file and pass this file in your other file like as a file. Then create a function in your file and pass this function in the demo.xml file.

    Using this code given below

    def productid_change(self,cr,uid,ids, product ,uom_id,  qty=0, name='', type='out_invoice',
                partner_id=False, fposition_id=False, price_unit=False, currency_id=False,
            res = super(account_invoice_line, self).product_id_change(cr,uid,ids,product, uom_id, qty, name,type, partner_id, fposition_id,price_unit, currency_id,company_id,context)
            if res['value'].get('name', False):
                name = res['value'].get('name', False)
                name = name.split(" ")
                prod_name=prod_name.replace("["," ")
                prod_name=prod_name.replace("]"," ")
      , uid, [('default_code', '=',prod_name)])
                product_obj1 = product_obj.browse(cr, uid, var, context=context)
                prod_type = product_obj1.supp_ref
                prod_price = product_obj1.lst_price
                squ_meter = product_obj1.squ_meter
                subtotal = (qty) * (prod_price)
                result['price_subtotal'] = subtotal
                result['qty_char'] = qty * squ_meter
                return {'value' : result}
            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: