Use shipment report mixin for delivery note
This commit is contained in:
1 parent
53c0edfe05
commit
567719b1ab
2 files changed
+25
-16
No files matched your search
@@ -514,7 +514,7 @@
|
||||
</table:table-header-rows>
|
||||
<table:table-row>
|
||||
<table:table-cell table:style-name="Table1.A2" table:number-columns-spanned="2" office:value-type="string">
|
||||
<text:p text:style-name="P11"><text:placeholder text:placeholder-type="text"><for each="move in shipment.outgoing_moves"></text:placeholder></text:p>
|
||||
<text:p text:style-name="P11"><text:placeholder text:placeholder-type="text"><for each="move in moves(shipment)"></text:placeholder></text:p>
|
||||
</table:table-cell>
|
||||
<table:covered-table-cell/>
|
||||
</table:table-row>
|
||||
|
||||
+24
-15
@@ -3033,23 +3033,8 @@ class AssignPartial(ModelView):
|
||||
help="The moves that were not assigned.")
|
||||
|
||||
|
||||
class DeliveryNote(CompanyReport):
|
||||
'Delivery Note'
|
||||
__name__ = 'stock.shipment.out.delivery_note'
|
||||
|
||||
@classmethod
|
||||
def execute(cls, ids, data):
|
||||
with Transaction().set_context(address_with_party=False):
|
||||
return super(DeliveryNote, cls).execute(ids, data)
|
||||
|
||||
|
||||
class ShipmentReport(CompanyReport):
|
||||
|
||||
@classmethod
|
||||
def execute(cls, ids, data):
|
||||
with Transaction().set_context(address_with_party=True):
|
||||
return super(ShipmentReport, cls).execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def moves(cls, shipment):
|
||||
raise NotImplementedError
|
||||
@@ -3065,6 +3050,25 @@ class ShipmentReport(CompanyReport):
|
||||
return report_context
|
||||
|
||||
|
||||
class DeliveryNote(ShipmentReport):
|
||||
'Delivery Note'
|
||||
__name__ = 'stock.shipment.out.delivery_note'
|
||||
|
||||
@classmethod
|
||||
def execute(cls, ids, data):
|
||||
with Transaction().set_context(address_with_party=False):
|
||||
return super(DeliveryNote, cls).execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def moves(cls, shipment):
|
||||
moves = shipment.outgoing_moves
|
||||
return sort(moves, cls.moves_order(shipment))
|
||||
|
||||
@classmethod
|
||||
def moves_order(cls, shipment):
|
||||
return shipment.__class__.outgoing_moves.order
|
||||
|
||||
|
||||
class PickingList(ShipmentReport):
|
||||
'Picking List'
|
||||
__name__ = 'stock.shipment.out.picking_list'
|
||||
@@ -3120,6 +3124,11 @@ class InteralShipmentReport(ShipmentReport):
|
||||
'Interal Shipment Report'
|
||||
__name__ = 'stock.shipment.internal.report'
|
||||
|
||||
@classmethod
|
||||
def execute(cls, ids, data):
|
||||
with Transaction().set_context(address_with_party=True):
|
||||
return super(ShipmentReport, cls).execute(ids, data)
|
||||
|
||||
@classmethod
|
||||
def moves(cls, shipment):
|
||||
if shipment.transit_location:
|
||||
|
||||
Reference in new issue
Block a user