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
|
2017-05-12 14:09:36 +02:00
|
|
|
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):
|
2017-05-12 14:09:36 +02:00
|
|
|
__name__ = 'stock.shipment.out.delivery_note'
|
2016-01-14 21:26:17 +01:00
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def execute(cls, ids, data):
|
|
|
|
pool = Pool()
|
|
|
|
Config = pool.get('stock.configuration')
|
2017-05-12 14:09:36 +02:00
|
|
|
|
2016-01-14 21:26:17 +01:00
|
|
|
config = Config(1)
|
|
|
|
parameters = {
|
2016-02-09 09:52:24 +01:00
|
|
|
'shipment_qty_decimal': config.shipment_qty_decimal or False
|
2016-01-14 21:26:17 +01:00
|
|
|
}
|
|
|
|
if 'parameters' in data:
|
2016-01-20 14:33:10 +01:00
|
|
|
data['parameters'].update(parameters)
|
2016-01-14 21:26:17 +01:00
|
|
|
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)
|