12345678910111213141516171819202122232425262728293031323334353637 |
- # -*- coding: utf-8 -*-
- from datetime import datetime, timedelta
- import time
- from openerp import SUPERUSER_ID
- from openerp.osv import fields, osv
- from openerp.tools.translate import _
- from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT
- import openerp.addons.decimal_precision as dp
- from openerp import workflow
- class sale_order(osv.osv):
- _inherit = "sale.order"
- def _amount_all_wrapper(self, cr, uid, ids, field_name, arg, context=None):
- """ Wrapper because of direct method passing as parameter for function fields """
- return self._amount_all(cr, uid, ids, field_name, arg, context=context)
- def _amount_all(self, cr, uid, ids, field_name, arg, context=None):
- cur_obj = self.pool.get('res.currency')
- res = {}
- # print "******************************algo*************************"
- # for order in self.browse(cr, uid, ids, context=context):
- # res[order.id] = {
- # 'amount_untaxed': 0.0,
- # 'amount_tax': 0.0,
- # 'amount_total': 0.0,
- # }
- # val = val1 = 0.0
- # cur = order.pricelist_id.currency_id
- # for line in order.order_line:
- # val1 += line.price_subtotal
- # val += self._amount_line_tax(cr, uid, line, context=context)
- # res[order.id]['amount_tax'] = cur_obj.round(cr, uid, cur, val)
- # res[order.id]['amount_untaxed'] = cur_obj.round(cr, uid, cur, val1)
- # res[order.id]['amount_total'] = res[order.id]['amount_untaxed'] + res[order.id]['amount_tax']
- # return res
|