summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/sale_order.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2022-10-24 14:08:18 +0700
committerstephanchrst <stephanchrst@gmail.com>2022-10-24 14:08:18 +0700
commit84cbe80ad4f6f2bcb99386d92be7cc210d481dea (patch)
tree16605b5ad2941ad59ba6642fd4ed8a9b35eb959d /indoteknik_custom/models/sale_order.py
parente0d9fdcfd618332d6324c244859e9cbbf3a6a225 (diff)
add real shipping address in sale order and stock picking
Diffstat (limited to 'indoteknik_custom/models/sale_order.py')
-rwxr-xr-xindoteknik_custom/models/sale_order.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py
index 48794f92..2151264c 100755
--- a/indoteknik_custom/models/sale_order.py
+++ b/indoteknik_custom/models/sale_order.py
@@ -36,6 +36,15 @@ class SaleOrder(models.Model):
have_outstanding_picking = fields.Boolean('Have Outstanding Picking', compute='_have_outstanding_picking')
have_outstanding_po = fields.Boolean('Have Outstanding PO', compute='_have_outstanding_po')
purchase_ids = fields.Many2many('purchase.order', string='Purchases', compute='_get_purchases')
+ real_shipping_id = fields.Many2one(
+ 'res.partner', string='Real Delivery Address', readonly=True, required=True,
+ states={'draft': [('readonly', False)], 'sent': [('readonly', False)], 'sale': [('readonly', False)]},
+ domain="['|', ('company_id', '=', False), ('company_id', '=', company_id)]",
+ help="Dipakai untuk alamat tempel")
+
+ @api.onchange('partner_shipping_id')
+ def onchange_partner_shipping(self):
+ self.real_shipping_id = self.partner_shipping_id
def _get_purchases(self):
po_state = ['done', 'draft', 'purchase']