summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-05-16 16:53:24 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-05-16 16:53:24 +0700
commit99faeeac589cee3da9f47dceaab7ebcb5f1c1213 (patch)
tree51951b908fcd71c357843035f136101eb0928543
parent23240cd6ba13e4737fa06e20a10c9d242e221eca (diff)
add role while edit shipping method stock picking
-rw-r--r--indoteknik_custom/models/stock_picking.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 9b4fffb1..c5ff4eb8 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -86,6 +86,11 @@ class StockPicking(models.Model):
date_availability = fields.Datetime(string="Date Availability", copy=False, tracking=True)
sale_order = fields.Char(string='Matches SO', copy=False)
+ @api.constrains('carrier_id')
+ def constrains_carrier_id(self):
+ if not self.env.user.logistic_approver:
+ raise UserError('Hanya Logistic yang bisa mengubah shipping method')
+
def do_unreserve(self):
res = super(StockPicking, self).do_unreserve()
current_time = datetime.datetime.utcnow()