Linkage report
This commit is contained in:
@@ -359,8 +359,9 @@ def register():
|
||||
invoice.SaleReport,
|
||||
invoice.PurchaseReport,
|
||||
stock.ShipmentShippingReport,
|
||||
stock.ShipmentInsuranceReport,
|
||||
stock.ShipmentCOOReport,
|
||||
stock.ShipmentPackingListReport,
|
||||
module='purchase_trade', type_='report')
|
||||
stock.ShipmentInsuranceReport,
|
||||
stock.ShipmentCOOReport,
|
||||
stock.ShipmentPackingListReport,
|
||||
stock.ShipmentLinkageReport,
|
||||
module='purchase_trade', type_='report')
|
||||
|
||||
|
||||
@@ -109,6 +109,8 @@ class Configuration(ModelSingleton, ModelSQL, ModelView):
|
||||
'report_shipment_in_coo', 'COO'),
|
||||
('shipment_packing_list_report_label', 'purchase_trade',
|
||||
'report_shipment_in_packing_list', 'Packing List'),
|
||||
('shipment_linkage_report_label', 'purchase_trade',
|
||||
'report_shipment_in_linkage', 'Linkage'),
|
||||
)
|
||||
_COFFEE_MENU_XML_IDS = (
|
||||
'menu_coffee_purchase',
|
||||
@@ -169,6 +171,8 @@ class Configuration(ModelSingleton, ModelSQL, ModelView):
|
||||
shipment_packing_list_report_template = fields.Char("Packing List Template")
|
||||
shipment_packing_list_report_label = fields.Char(
|
||||
"Packing List Menu Label")
|
||||
shipment_linkage_report_template = fields.Char("Linkage Template")
|
||||
shipment_linkage_report_label = fields.Char("Linkage Menu Label")
|
||||
|
||||
@classmethod
|
||||
def __register__(cls, module_name):
|
||||
|
||||
@@ -4168,6 +4168,15 @@ class ShipmentPackingListReport(ShipmentTemplateReportMixin, BaseSupplierShippin
|
||||
'shipment_packing_list_report_template', 'stock')
|
||||
|
||||
|
||||
class ShipmentLinkageReport(ShipmentTemplateReportMixin, BaseSupplierShipping):
|
||||
__name__ = 'stock.shipment.in.linkage'
|
||||
|
||||
@classmethod
|
||||
def _resolve_configured_report_path(cls, action):
|
||||
return cls._resolve_template_path(
|
||||
'shipment_linkage_report_template', 'stock')
|
||||
|
||||
|
||||
class ShipmentCOOReport(ShipmentTemplateReportMixin, BaseSupplierShipping):
|
||||
__name__ = 'stock.shipment.in.coo'
|
||||
|
||||
|
||||
@@ -247,10 +247,22 @@ this repository contains the full copyright notices and license terms. -->
|
||||
<field name="model">stock.shipment.in,-1</field>
|
||||
<field name="action" ref="report_shipment_in_packing_list"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.action.wizard" id="act_update_sof">
|
||||
<field name="name">Update with SoF PDF</field>
|
||||
<field name="wiz_name">sof.update</field>
|
||||
|
||||
<record model="ir.action.report" id="report_shipment_in_linkage">
|
||||
<field name="name">Linkage</field>
|
||||
<field name="model">stock.shipment.in</field>
|
||||
<field name="report_name">stock.shipment.in.linkage</field>
|
||||
<field name="report">stock/linkage.fodt</field>
|
||||
</record>
|
||||
<record model="ir.action.keyword" id="report_shipment_in_linkage_keyword">
|
||||
<field name="keyword">form_print</field>
|
||||
<field name="model">stock.shipment.in,-1</field>
|
||||
<field name="action" ref="report_shipment_in_linkage"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.action.wizard" id="act_update_sof">
|
||||
<field name="name">Update with SoF PDF</field>
|
||||
<field name="wiz_name">sof.update</field>
|
||||
<field name="model">stock.shipment.in</field>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -6174,6 +6174,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
insurance_report = Pool().get('stock.shipment.in.insurance', type='report')
|
||||
coo_report = Pool().get('stock.shipment.in.coo', type='report')
|
||||
packing_report = Pool().get('stock.shipment.in.packing_list', type='report')
|
||||
linkage_report = Pool().get('stock.shipment.in.linkage', type='report')
|
||||
config_model = Mock()
|
||||
config_model.search.return_value = [
|
||||
Mock(
|
||||
@@ -6181,6 +6182,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
shipment_insurance_report_template='insurance_custom.fodt',
|
||||
shipment_coo_report_template='coo_custom.fodt',
|
||||
shipment_packing_list_report_template='packing_list_custom.fodt',
|
||||
shipment_linkage_report_template='linkage_custom.fodt',
|
||||
)
|
||||
]
|
||||
|
||||
@@ -6213,6 +6215,12 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
'report': 'stock/packing_list.fodt',
|
||||
}),
|
||||
'stock/packing_list_custom.fodt')
|
||||
self.assertEqual(
|
||||
linkage_report._resolve_configured_report_path({
|
||||
'name': 'Linkage',
|
||||
'report': 'stock/linkage.fodt',
|
||||
}),
|
||||
'stock/linkage_custom.fodt')
|
||||
|
||||
def test_configuration_syncs_report_menu_labels(self):
|
||||
'document template configuration updates report menu labels'
|
||||
@@ -6230,6 +6238,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
shipment_insurance_report_label='',
|
||||
shipment_coo_report_label='Certificate of Origin',
|
||||
shipment_packing_list_report_label='',
|
||||
shipment_linkage_report_label='Linkage Summary',
|
||||
)
|
||||
action_sale = Mock(spec=['name'])
|
||||
action_sale.name = 'Proforma'
|
||||
@@ -6255,6 +6264,8 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
action_coo.name = 'COO'
|
||||
action_packing = Mock(spec=['name'])
|
||||
action_packing.name = 'Packing List'
|
||||
action_linkage = Mock(spec=['name'])
|
||||
action_linkage.name = 'Linkage'
|
||||
actions = {
|
||||
1: action_sale,
|
||||
2: action_bill,
|
||||
@@ -6268,6 +6279,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
10: action_insurance,
|
||||
11: action_coo,
|
||||
12: action_packing,
|
||||
13: action_linkage,
|
||||
}
|
||||
|
||||
model_data = Mock()
|
||||
@@ -6296,6 +6308,7 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
||||
[actions[7]], {'name': 'Packing Slip'},
|
||||
[actions[6]], {'name': 'Wire Order'},
|
||||
[actions[11]], {'name': 'Certificate of Origin'},
|
||||
[actions[13]], {'name': 'Linkage Summary'},
|
||||
))
|
||||
|
||||
def test_shipment_insurance_helpers_use_fee_and_controller(self):
|
||||
|
||||
@@ -71,4 +71,8 @@
|
||||
<field name="shipment_packing_list_report_template" colspan="3"/>
|
||||
<label name="shipment_packing_list_report_label"/>
|
||||
<field name="shipment_packing_list_report_label" colspan="3"/>
|
||||
<label name="shipment_linkage_report_template"/>
|
||||
<field name="shipment_linkage_report_template" colspan="3"/>
|
||||
<label name="shipment_linkage_report_label"/>
|
||||
<field name="shipment_linkage_report_label" colspan="3"/>
|
||||
</form>
|
||||
|
||||
Reference in New Issue
Block a user