FIX mrp_usability: define sold out in bottom page

This commit is contained in:
David Beal
2020-10-06 16:28:43 +02:00
parent 58f01d9673
commit f605b56a5e
3 changed files with 36 additions and 22 deletions

View File

@@ -3,9 +3,18 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models
from odoo import api, models
class MrpProduction(models.Model):
_inherit = 'mrp.production'
_order = 'id desc'
@api.model
def get_stock_move_sold_out_report(self, move):
lines = move.active_move_line_ids
qty_in_lots = sum([x.product_uom_qty for x in lines])
diff = round(move.product_qty - qty_in_lots, 3)
if diff == 0.0:
return ""
return diff