diff --git a/ereuse_devicehub/resources/action/models.py b/ereuse_devicehub/resources/action/models.py
index b0bc435f..4e732ed2 100644
--- a/ereuse_devicehub/resources/action/models.py
+++ b/ereuse_devicehub/resources/action/models.py
@@ -1445,6 +1445,32 @@ class Receive(JoinedTableMixin, ActionWithMultipleDevices):
default=ReceiverRole.Intermediary)
+class ShareDeliveryNote(JoinedTableMixin, ActionWithMultipleDevices):
+ """To share a DeliveryNote to between owners."""
+ # New variables for DeliveryNote
+ supplier = db.Column() # String, nullable, ...
+ supplier.comment = """Name of the organization/agent that create DeliveryNote."""
+ date_delivery_note = db.Column()
+ date_delivery_note.comment = """Date of note creation."""
+ # Is the same of lot id??
+ id_delivery_note = db.Column(UUID(as_uuid=True))
+ id_delivery_note.comment = """Unique id of lot and delivery note."""
+ deposit = db.Column()
+ deposit.comment = """Total amount of deposit devices in Lot."""
+ address_note = db.Column(UUID(as_uuid=True))
+ address_note.comment = """Address identifier in the blockchain."""
+
+ agent_id = Column(UUID(as_uuid=True),
+ ForeignKey(Agent.id),
+ nullable=False,
+ default=lambda: g.user.individual.id)
+
+
+class ConfirmDeliveryNote(JoinedTableMixin, ActionWithMultipleDevices):
+ """To confirm a DeliveryNote that has been shared."""
+ pass
+
+
class Migrate(JoinedTableMixin, ActionWithMultipleDevices):
"""Moves the devices to a new database/inventory. Devices cannot be
modified anymore at the previous database.
diff --git a/ereuse_devicehub/resources/action/models.pyi b/ereuse_devicehub/resources/action/models.pyi
index 6d9ab5b4..c7969094 100644
--- a/ereuse_devicehub/resources/action/models.pyi
+++ b/ereuse_devicehub/resources/action/models.pyi
@@ -529,6 +529,10 @@ class Receive(ActionWithMultipleDevices):
self.role = ... # type: ReceiverRole
+class ShareDeliveryNote(ActionWithMultipleDevices):
+ pass
+
+
class Migrate(ActionWithMultipleDevices):
other = ... # type: Column
diff --git a/ereuse_devicehub/resources/action/schemas.py b/ereuse_devicehub/resources/action/schemas.py
index 1c86d358..0f1e4544 100644
--- a/ereuse_devicehub/resources/action/schemas.py
+++ b/ereuse_devicehub/resources/action/schemas.py
@@ -434,6 +434,15 @@ class Receive(ActionWithMultipleDevices):
role = EnumField(ReceiverRole)
+class ShareDeliveryNote(ActionWithMultipleDevices):
+ __doc__ = m.ShareDeliveryNote.__doc__
+ supplier = SanitizedStr(validate=Length(max=STR_SIZE), data_key='supplierName')
+ date_delivery_note = DateTime(data_key='dateDeliveryNote')
+ deposit = Integer(data_key='depositValue')
+ address_note = UUID(dump_only=True)
+ id_delivery_note = UUID(dump_only=True)
+
+
class Migrate(ActionWithMultipleDevices):
__doc__ = m.Migrate.__doc__
other = URL()
diff --git a/ereuse_devicehub/resources/device/models.py b/ereuse_devicehub/resources/device/models.py
index cf508882..26298909 100644
--- a/ereuse_devicehub/resources/device/models.py
+++ b/ereuse_devicehub/resources/device/models.py
@@ -92,8 +92,7 @@ class Device(Thing):
color.comment = """The predominant color of the device."""
production_date = Column(db.DateTime)
production_date.comment = """The date of production of the device.
- This is timezone naive, as Workbench cannot report this data
- with timezone information.
+ This is timezone naive, as Workbench cannot report this data with timezone information.
"""
variant = Column(db.CIText())
variant.comment = """A variant or sub-model of the device."""
diff --git a/ereuse_devicehub/resources/documents/templates/documents/layout.html b/ereuse_devicehub/resources/documents/templates/documents/layout.html
index 45f16861..3794f343 100644
--- a/ereuse_devicehub/resources/documents/templates/documents/layout.html
+++ b/ereuse_devicehub/resources/documents/templates/documents/layout.html
@@ -11,7 +11,7 @@
-