trytond-stock_delivery_note.../shipment.py

86 lines
2.6 KiB
Python
Raw Permalink Normal View History

2017-03-14 19:23:36 +01:00
# This file is part stock_delivery_note_jreport module for Tryton.
2014-11-07 14:44:13 +01:00
# The COPYRIGHT file at the top level of this repository contains
# the full copyright notices and license terms.
2017-03-14 19:23:36 +01:00
from trytond.pool import Pool
from trytond.pool import PoolMeta
2013-08-29 13:16:15 +02:00
from trytond.modules.jasper_reports.jasper import JasperReport
2018-05-03 23:34:44 +02:00
__all__ = ['DeliveryNote', 'PickingList', 'DeliveryNoteReturn',
'DeliveryNoteValued']
2013-08-29 13:16:15 +02:00
2018-08-24 12:24:30 +02:00
class DeliveryNote(JasperReport, metaclass=PoolMeta):
__name__ = 'stock.shipment.out.delivery_note'
@classmethod
def execute(cls, ids, data):
pool = Pool()
Config = pool.get('stock.configuration')
config = Config(1)
parameters = {
'shipment_qty_decimal': config.shipment_qty_decimal or False
}
if 'parameters' in data:
data['parameters'].update(parameters)
else:
data['parameters'] = parameters
return super(DeliveryNote, cls).execute(ids, data)
2017-06-06 14:17:08 +02:00
2018-08-24 12:24:30 +02:00
class PickingList(JasperReport, metaclass=PoolMeta):
2017-06-06 14:17:08 +02:00
__name__ = 'stock.shipment.out.picking_list'
@classmethod
def execute(cls, ids, data):
pool = Pool()
Config = pool.get('stock.configuration')
config = Config(1)
parameters = {
'shipment_qty_decimal': config.shipment_qty_decimal or False
}
if 'parameters' in data:
data['parameters'].update(parameters)
else:
data['parameters'] = parameters
return super(PickingList, cls).execute(ids, data)
2017-11-09 14:54:50 +01:00
2018-08-24 12:24:30 +02:00
class DeliveryNoteReturn(JasperReport, metaclass=PoolMeta):
2017-11-09 14:54:50 +01:00
__name__ = 'stock.shipment.out.delivery_note.return'
@classmethod
def execute(cls, ids, data):
pool = Pool()
Config = pool.get('stock.configuration')
config = Config(1)
parameters = {
'shipment_qty_decimal': config.shipment_qty_decimal or False
}
if 'parameters' in data:
data['parameters'].update(parameters)
else:
data['parameters'] = parameters
return super(DeliveryNoteReturn, cls).execute(ids, data)
2018-05-03 23:34:44 +02:00
class DeliveryNoteValued(JasperReport):
__name__ = 'stock.shipment.out.delivery_note_valued'
@classmethod
def execute(cls, ids, data):
pool = Pool()
Config = pool.get('stock.configuration')
config = Config(1)
parameters = {
'shipment_qty_decimal': config.shipment_qty_decimal or False
}
if 'parameters' in data:
data['parameters'].update(parameters)
else:
data['parameters'] = parameters
return super(DeliveryNoteValued, cls).execute(ids, data)