summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/shipment_group.py5
-rw-r--r--indoteknik_custom/views/shipment_group.xml1
2 files changed, 6 insertions, 0 deletions
diff --git a/indoteknik_custom/models/shipment_group.py b/indoteknik_custom/models/shipment_group.py
index 92f76db7..df3f1bb4 100644
--- a/indoteknik_custom/models/shipment_group.py
+++ b/indoteknik_custom/models/shipment_group.py
@@ -31,6 +31,10 @@ class ShipmentGroupLine(models.Model):
picking_id = fields.Many2one('stock.picking', string='Picking')
sale_id = fields.Many2one('sale.order', string='Sale Order')
state = fields.Char(string='Status', readonly=True, compute='_compute_state')
+ shipping_paid_by = fields.Selection([
+ ('indoteknik', 'Indoteknik'),
+ ('customer', 'Customer')
+ ], string='Shipping Paid by', copy=False)
@api.depends('picking_id.state')
def _compute_state(self):
@@ -60,6 +64,7 @@ class ShipmentGroupLine(models.Model):
raise UserError('Partner must be same as shipment group')
self.partner_id = picking.partner_id
+ self.shipping_paid_by = picking.sale_id.shipping_paid_by
if not self.shipment_id.partner_id:
self.shipment_id.partner_id = picking.partner_id
diff --git a/indoteknik_custom/views/shipment_group.xml b/indoteknik_custom/views/shipment_group.xml
index b66bda3c..e9eec41b 100644
--- a/indoteknik_custom/views/shipment_group.xml
+++ b/indoteknik_custom/views/shipment_group.xml
@@ -19,6 +19,7 @@
<field name="picking_id" required="1"/>
<field name="partner_id" readonly="1"/>
<field name="sale_id" readonly="1"/>
+ <field name="shipping_paid_by" readonly="1"/>
<field name="state" readonly="1"/>
</tree>
</field>