mirror of
https://gitlab.com/datalifeit/trytond-stock_shipment_web_link
synced 2023-12-14 05:33:06 +01:00
parent
9a5efcdcb9
commit
330bf70d27
24
shipment.py
24
shipment.py
|
@ -174,6 +174,10 @@ class ShipmentWebLinkMixin(object):
|
|||
def get_to_email(self):
|
||||
return self.warehouse.address.party.email
|
||||
|
||||
@classmethod
|
||||
def get_weblink_report_file(cls, shipments):
|
||||
raise NotImplementedError()
|
||||
|
||||
|
||||
class ShipmentOut(ShipmentWebLinkMixin, metaclass=PoolMeta):
|
||||
__name__ = 'stock.shipment.out'
|
||||
|
@ -194,6 +198,13 @@ class ShipmentOut(ShipmentWebLinkMixin, metaclass=PoolMeta):
|
|||
return self.get_email(
|
||||
'stock.shipment.out.web_link', self, self.get_languages(user))
|
||||
|
||||
@classmethod
|
||||
def get_weblink_report_file(cls, shipments):
|
||||
ReportShipmentOut = Pool().get('stock.shipment.out.delivery_note',
|
||||
type='report')
|
||||
|
||||
return ReportShipmentOut.execute(list(map(int, shipments)), {})
|
||||
|
||||
|
||||
class ShipmentIn(ShipmentWebLinkMixin, metaclass=PoolMeta):
|
||||
__name__ = 'stock.shipment.in'
|
||||
|
@ -231,6 +242,13 @@ class ShipmentIn(ShipmentWebLinkMixin, metaclass=PoolMeta):
|
|||
super(ShipmentIn, cls).send_link(shipments, length=length, from_=from_,
|
||||
email=email, send_mail=send_mail, raise_error=raise_error)
|
||||
|
||||
@classmethod
|
||||
def get_weblink_report_file(cls, shipments):
|
||||
ReportShipmentIn = Pool().get('stock.shipment.in.delivery_receipt',
|
||||
type='report')
|
||||
|
||||
return ReportShipmentIn.execute(list(map(int, shipments)), {})
|
||||
|
||||
|
||||
class ShipmentInternal(ShipmentWebLinkMixin, metaclass=PoolMeta):
|
||||
__name__ = 'stock.shipment.internal'
|
||||
|
@ -254,6 +272,12 @@ class ShipmentInternal(ShipmentWebLinkMixin, metaclass=PoolMeta):
|
|||
def get_to_email(self):
|
||||
return self.company.party.email
|
||||
|
||||
@classmethod
|
||||
def get_weblink_report_file(cls, shipments):
|
||||
ReportShipmentInternal = Pool().get('stock.shipment.internal.report',
|
||||
type='report')
|
||||
return ReportShipmentInternal.execute(list(map(int, shipments)), {})
|
||||
|
||||
|
||||
class SendLinkStart(ModelView):
|
||||
"""Shipment Send Link Start"""
|
||||
|
|
Loading…
Reference in a new issue