diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-09-03 15:20:06 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-09-03 15:20:06 +0700 |
| commit | 8edde46e16d4d977e84a3681c03d1bfab8591a71 (patch) | |
| tree | e320dac54a3d4fc9bead223045948ab011c66a0b /indoteknik_custom/models | |
| parent | 9ee856d603530e8cc3494a2bccb8fdfaa328da6a (diff) | |
cr unreserved
Diffstat (limited to 'indoteknik_custom/models')
| -rwxr-xr-x | indoteknik_custom/models/sale_order.py | 3 | ||||
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 2 |
2 files changed, 2 insertions, 3 deletions
diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 2769d408..d389f6ae 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -116,9 +116,8 @@ class SaleOrder(models.Model): if user_id != self.user_id.id: raise UserError(_("Only the user who created the picking can unreserve it.")) - self.unreserve_id.do_unreserve() + self.unreserve_id.with_context({'darimana': 'sale.order'}).do_unreserve() - def _compute_date_kirim(self): for rec in self: picking = self.env['stock.picking'].search([('sale_id', '=', rec.id), ('state', 'not in', ['cancel'])], order='date_doc_kirim desc', limit=1) diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 474c7526..de45af2e 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -125,7 +125,7 @@ class StockPicking(models.Model): raise UserError('Hanya Logistic yang bisa mengubah shipping method') def do_unreserve(self): - if self.sale_id.unreserve_id.id != self.id: + if not self._context.get('darimana') == 'sale.order': self.sale_id.unreserve_id = self.id return self._create_approval_notification('Logistic') |
