Add surveyor on shipment
This commit is contained in:
@@ -315,6 +315,7 @@ Source code: `modules/purchase_trade/stock.py`
|
|||||||
- `report_insurance_incoming_amount`
|
- `report_insurance_incoming_amount`
|
||||||
- `report_insurance_amount_insured`
|
- `report_insurance_amount_insured`
|
||||||
- `report_insurance_surveyor`
|
- `report_insurance_surveyor`
|
||||||
|
- `report_insurance_contact_surveyor`
|
||||||
- `report_insurance_issue_place_and_date`
|
- `report_insurance_issue_place_and_date`
|
||||||
|
|
||||||
Usage typique:
|
Usage typique:
|
||||||
@@ -326,6 +327,9 @@ Usage typique:
|
|||||||
(`lot.line.unit_price * lot.get_current_quantity_converted()`)
|
(`lot.line.unit_price * lot.get_current_quantity_converted()`)
|
||||||
- `report_insurance_amount_insured`: `110%` de
|
- `report_insurance_amount_insured`: `110%` de
|
||||||
`report_insurance_incoming_amount`
|
`report_insurance_incoming_amount`
|
||||||
|
- `report_insurance_contact_surveyor`: surveyor affiche sous
|
||||||
|
`Contact the following surveyor` (priorite au champ shipment `surveyor`,
|
||||||
|
puis fallback controller / fee `Insurance`)
|
||||||
- base de travail pour un certificat d'assurance lie a un shipment
|
- base de travail pour un certificat d'assurance lie a un shipment
|
||||||
|
|
||||||
## 10) Recommandations
|
## 10) Recommandations
|
||||||
|
|||||||
@@ -441,9 +441,10 @@ class ShipmentIn(metaclass=PoolMeta):
|
|||||||
'shipment',
|
'shipment',
|
||||||
'Container'
|
'Container'
|
||||||
)
|
)
|
||||||
shipment_wr = fields.One2Many('shipment.wr','shipment_in',"WR")
|
shipment_wr = fields.One2Many('shipment.wr','shipment_in',"WR")
|
||||||
controller = fields.Many2One('party.party',"Controller")
|
controller = fields.Many2One('party.party',"Controller")
|
||||||
controller_target = fields.Char("Targeted controller")
|
surveyor = fields.Many2One('party.party', "Surveyor")
|
||||||
|
controller_target = fields.Char("Targeted controller")
|
||||||
send_instruction = fields.Boolean("Send instruction")
|
send_instruction = fields.Boolean("Send instruction")
|
||||||
instructions = fields.Text("Instructions")
|
instructions = fields.Text("Instructions")
|
||||||
add_bl = fields.Boolean("Add BL")
|
add_bl = fields.Boolean("Add BL")
|
||||||
@@ -625,12 +626,18 @@ class ShipmentIn(metaclass=PoolMeta):
|
|||||||
|
|
||||||
@property
|
@property
|
||||||
def report_insurance_surveyor(self):
|
def report_insurance_surveyor(self):
|
||||||
|
if self.surveyor:
|
||||||
|
return self.surveyor.rec_name or ''
|
||||||
if self.controller:
|
if self.controller:
|
||||||
return self.controller.rec_name or ''
|
return self.controller.rec_name or ''
|
||||||
fee = self._get_report_insurance_fee()
|
fee = self._get_report_insurance_fee()
|
||||||
supplier = getattr(fee, 'supplier', None) if fee else None
|
supplier = getattr(fee, 'supplier', None) if fee else None
|
||||||
return getattr(supplier, 'rec_name', '') or ''
|
return getattr(supplier, 'rec_name', '') or ''
|
||||||
|
|
||||||
|
@property
|
||||||
|
def report_insurance_contact_surveyor(self):
|
||||||
|
return self.report_insurance_surveyor
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def report_insurance_issue_place_and_date(self):
|
def report_insurance_issue_place_and_date(self):
|
||||||
Date = Pool().get('ir.date')
|
Date = Pool().get('ir.date')
|
||||||
|
|||||||
@@ -530,6 +530,19 @@ class PurchaseTradeTestCase(ModuleTestCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
shipment.report_insurance_amount, 'USD 550.00')
|
shipment.report_insurance_amount, 'USD 550.00')
|
||||||
|
|
||||||
|
def test_shipment_insurance_contact_surveyor_prefers_shipment_surveyor(self):
|
||||||
|
'insurance contact surveyor property uses shipment surveyor first'
|
||||||
|
ShipmentIn = Pool().get('stock.shipment.in')
|
||||||
|
shipment = ShipmentIn()
|
||||||
|
shipment.surveyor = Mock(rec_name='SGS')
|
||||||
|
shipment.controller = Mock(rec_name='CONTROL UNION')
|
||||||
|
shipment.fees = []
|
||||||
|
|
||||||
|
self.assertEqual(
|
||||||
|
shipment.report_insurance_contact_surveyor, 'SGS')
|
||||||
|
self.assertEqual(
|
||||||
|
shipment.report_insurance_surveyor, 'SGS')
|
||||||
|
|
||||||
def test_sale_report_multi_line_helpers_aggregate_all_lines(self):
|
def test_sale_report_multi_line_helpers_aggregate_all_lines(self):
|
||||||
'sale report helpers aggregate quantity, price lines and shipment periods'
|
'sale report helpers aggregate quantity, price lines and shipment periods'
|
||||||
Sale = Pool().get('sale.sale')
|
Sale = Pool().get('sale.sale')
|
||||||
|
|||||||
@@ -137,5 +137,9 @@ this repository contains the full copyright notices and license terms. -->
|
|||||||
<newline/>
|
<newline/>
|
||||||
<field name="shipment_wr" colspan="4" mode="tree" view_ids="purchase_trade.shipment_wr_view_tree"/>
|
<field name="shipment_wr" colspan="4" mode="tree" view_ids="purchase_trade.shipment_wr_view_tree"/>
|
||||||
</page>
|
</page>
|
||||||
|
<page string="Surveyor" col="4" id="surveyor">
|
||||||
|
<label name="surveyor"/>
|
||||||
|
<field name="surveyor"/>
|
||||||
|
</page>
|
||||||
</xpath>
|
</xpath>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -1051,7 +1051,7 @@
|
|||||||
<text:p text:style-name="P32">applicable) and strike as per hte according Clauses.</text:p>
|
<text:p text:style-name="P32">applicable) and strike as per hte according Clauses.</text:p>
|
||||||
<text:p text:style-name="P34"/>
|
<text:p text:style-name="P34"/>
|
||||||
<text:h text:style-name="P43" text:outline-level="2">In case of loss and/or damage, contact the following surveyor:</text:h>
|
<text:h text:style-name="P43" text:outline-level="2">In case of loss and/or damage, contact the following surveyor:</text:h>
|
||||||
<text:h text:style-name="P44" text:outline-level="2"><text:placeholder text:placeholder-type="text"><records[0].report_insurance_surveyor or ''></text:placeholder></text:h>
|
<text:h text:style-name="P44" text:outline-level="2"><text:placeholder text:placeholder-type="text"><records[0].report_insurance_contact_surveyor or ''></text:placeholder></text:h>
|
||||||
<text:p text:style-name="P23"/>
|
<text:p text:style-name="P23"/>
|
||||||
<text:p text:style-name="P23"/>
|
<text:p text:style-name="P23"/>
|
||||||
<text:p text:style-name="P17">Surveyor's functions are limited to that of an independent observer retained for the sole purpose of reporting on the nature extent and proximate cause of loss; the surveyor has no authority to represent underwriters with regard to the terms and conditions of the contract.</text:p>
|
<text:p text:style-name="P17">Surveyor's functions are limited to that of an independent observer retained for the sole purpose of reporting on the nature extent and proximate cause of loss; the surveyor has no authority to represent underwriters with regard to the terms and conditions of the contract.</text:p>
|
||||||
@@ -1071,3 +1071,4 @@
|
|||||||
</office:text>
|
</office:text>
|
||||||
</office:body>
|
</office:body>
|
||||||
</office:document>
|
</office:document>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user