summaryrefslogtreecommitdiff
path: root/fixco_custom/models/stock_picking.py
diff options
context:
space:
mode:
Diffstat (limited to 'fixco_custom/models/stock_picking.py')
-rwxr-xr-xfixco_custom/models/stock_picking.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/fixco_custom/models/stock_picking.py b/fixco_custom/models/stock_picking.py
index 0eebe6a..a91274c 100755
--- a/fixco_custom/models/stock_picking.py
+++ b/fixco_custom/models/stock_picking.py
@@ -126,7 +126,7 @@ class StockPicking(models.Model):
])
if quant:
- return quant.quantity
+ return sum(quant.mapped('quantity'))
return 0
@@ -293,10 +293,12 @@ class StockPicking(models.Model):
raise UserError(
'Hanya Accounting yang bisa melakukan cancel karena di po nya sudah ada uang muka'
)
- res = super(StockPicking, self).action_cancel()
- if self.picking_type_code == 'incoming' and self.name.startswith('BU/IN'):
- self.set_po_bill_status()
+ if picking.picking_type_code == 'incoming' and picking.name.startswith('BU/IN'):
+ picking.set_po_bill_status()
+
+
+ res = super(StockPicking, self).action_cancel()
return res