[IMP] sale_journal: 'picking journal' report now uses decimal.precision

bzr revid: olt@tinyerp.com-20101004112702-w7wky190ntlexl7k
This commit is contained in:
olt@tinyerp.com 2010-10-04 13:27:02 +02:00
parent 471df15854
commit dfc45323ff
1 changed files with 26 additions and 24 deletions

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
############################################################################## ##############################################################################
# #
# OpenERP, Open Source Management Solution # OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
# #
@ -15,12 +15,14 @@
# GNU Affero General Public License for more details. # GNU Affero General Public License for more details.
# #
# You should have received a copy of the GNU Affero General Public License # You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
# #
############################################################################## ##############################################################################
from osv import fields, osv from osv import fields, osv
import tools import tools
from decimal_precision import decimal_precision as dp
class sale_journal_picking_report(osv.osv): class sale_journal_picking_report(osv.osv):
""" """
@ -30,32 +32,32 @@ class sale_journal_picking_report(osv.osv):
_description = "Picking lists" _description = "Picking lists"
_auto = False _auto = False
_columns = { _columns = {
'name': fields.char('Year', size=64, required=False, readonly=True), 'name': fields.char('Year', size=64, required=False, readonly=True),
'month': fields.selection([('01', 'January'), ('02', 'February'), ('03', 'March'), ('04', 'April'), ('05', 'May'), ('06', 'June'), 'month': fields.selection([('01', 'January'), ('02', 'February'), ('03', 'March'), ('04', 'April'), ('05', 'May'), ('06', 'June'),
('07', 'July'), ('08', 'August'), ('09', 'September'), ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly=True), ('07', 'July'), ('08', 'August'), ('09', 'September'), ('10', 'October'), ('11', 'November'), ('12', 'December')], 'Month', readonly=True),
'invoice_state':fields.selection([ 'invoice_state':fields.selection([
("invoiced", "invoiced"), ("invoiced", "invoiced"),
("2binvoiced", "to be invoiced"), ("2binvoiced", "to be invoiced"),
("none", "None") ("none", "None")
], "Invoice state", readonly=True), ], "Invoice state", readonly=True),
'state': fields.selection([ 'state': fields.selection([
('draft', 'draft'), ('draft', 'draft'),
('auto', 'waiting'), ('auto', 'waiting'),
('confirmed', 'confirmed'), ('confirmed', 'confirmed'),
('assigned', 'assigned'), ('assigned', 'assigned'),
('done', 'done'), ('done', 'done'),
('cancel', 'cancel'), ('cancel', 'cancel'),
], 'State', readonly=True), ], 'State', readonly=True),
'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoicing method', readonly=True), 'invoice_type_id': fields.many2one('sale_journal.invoice.type', 'Invoicing method', readonly=True),
'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal', readonly=True), 'journal_id': fields.many2one('sale_journal.picking.journal', 'Journal', readonly=True),
'quantity': fields.float('Quantities', readonly=True), 'quantity': fields.float('Quantities', readonly=True),
'price_total': fields.float('Total Price', readonly=True), 'price_total': fields.float('Total Price', readonly=True, digits_compute=dp.get_precision('Sale Price')),
'price_average': fields.float('Average Price', readonly=True), 'price_average': fields.float('Average Price', readonly=True, digits_compute=dp.get_precision('Sale Price')),
'count': fields.integer('# of Lines', readonly=True), 'count': fields.integer('# of Lines', readonly=True),
} }
_order = 'journal_id, name desc, price_total desc' _order = 'journal_id, name desc, price_total desc'
def init(self, cr): def init(self, cr):
tools.drop_view_if_exists(cr, 'sale_journal_picking_report') tools.drop_view_if_exists(cr, 'sale_journal_picking_report')
@ -80,7 +82,7 @@ class sale_journal_picking_report(osv.osv):
order by s.invoice_type_id, s.invoice_state, s.state order by s.invoice_type_id, s.invoice_state, s.state
) )
""") """)
sale_journal_picking_report() sale_journal_picking_report()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: