如何让销售模块中的小计显示为含税小计
-
POS模块有类似的功能
<br />class pos_order_line(osv.osv):<br /> _name = "pos.order.line"<br /> _description = "Lines of Point of Sale"<br /> _rec_name = "product_id"<br /><br /> def _amount_line_all(self, cr, uid, ids, field_names, arg, context=None):<br /> res = dict([(i, {}) for i in ids])<br /> account_tax_obj = self.pool.get('account.tax')<br /> cur_obj = self.pool.get('res.currency')<br /> for line in self.browse(cr, uid, ids, context=context):<br /> taxes_ids = [ tax for tax in line.product_id.taxes_id if tax.company_id.id == line.order_id.company_id.id ]<br /> price = line.price_unit * (1 - (line.discount or 0.0) / 100.0)<br /> taxes = account_tax_obj.compute_all(cr, uid, taxes_ids, price, line.qty, product=line.product_id, partner=line.order_id.partner_id or False)<br /><br /> cur = line.order_id.pricelist_id.currency_id<br /> res[line.id]['price_subtotal'] = cur_obj.round(cr, uid, cur, taxes['total'])<br /> res[line.id]['price_subtotal_incl'] = cur_obj.round(cr, uid, cur, taxes['total_included'])<br /> return res<br /><br /><br />