Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

 1 Answer(s)

  • Found Solution This is what I want to do

     from openerp.osv import osv,  fields
    import openerp.addons.decimal_precision as dp
    from openerp.tools.float_utils import float_compare

    class company(osv.osv): _inherit = 'account.tax' _columns = { 'Tax_Included_In_Costprice': fields.boolean('Tax included in cost price', help="Do cost price include tax?"), }

    class purchase_order_line(osv.osv): _inherit = 'purchase.order.line' def _compute_total(self, cr, uid, ids, prop, arg, context=None): res = {} cur_obj=self.pool.get('res.currency') tax_obj = self.pool.get('account.tax') for line in self.browse(cr, uid, ids, context=context): unit_price = line.price_unit if line.item_seller_price != 0: unit_price = line.item_seller_price taxes = tax_obj.compute_all(cr, uid, line.taxes_id, unit_price, line.product_qty, line.product_id, line.order_id.partner_id) cur = line.order_id.pricelist_id.currency_id res[line.id] = cur_obj.round(cr, uid, cur, taxes['total_included']-taxes['total']) return res

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: