From bb49da69c2af4d32c6bbc99cbc74e86e1f695424 Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Fri, 12 Sep 2025 15:00:12 +0700 Subject: schema sisa uang muka --- fixco_custom/models/stock_picking.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'fixco_custom/models/stock_picking.py') diff --git a/fixco_custom/models/stock_picking.py b/fixco_custom/models/stock_picking.py index 408e055..73f4175 100755 --- a/fixco_custom/models/stock_picking.py +++ b/fixco_custom/models/stock_picking.py @@ -45,6 +45,15 @@ class StockPicking(models.Model): ) is_printed = fields.Boolean(string="Sudah Dicetak", default=False) + def action_cancel(self): + for picking in self: + if not self.env.user.id == 13: + if picking.purchase_id.move_entry_id: + raise UserError( + 'Hanya Accounting yang bisa melakukan cancel karena di po nya sudah ada uang muka' + ) + super(StockPicking, self).action_cancel() + def action_create_invoice_from_mr(self): """Create the invoice associated to the PO. """ -- cgit v1.2.3