[IMP] stock_account: extend replenishment report
Adds the value on hand in the replenishment report. task-2058495
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import models
|
||||
from . import report
|
||||
from . import wizard
|
||||
|
||||
from odoo import api, SUPERUSER_ID, _, tools
|
||||
|
||||
@@ -32,7 +32,8 @@ Dashboard / Reports for Warehouse Management includes:
|
||||
'views/product_views.xml',
|
||||
'views/stock_quant_views.xml',
|
||||
'views/stock_valuation_layer_views.xml',
|
||||
'wizard/stock_valuation_layer_revaluation_views.xml'
|
||||
'wizard/stock_valuation_layer_revaluation_views.xml',
|
||||
'report/report_stock_forecasted.xml',
|
||||
],
|
||||
'test': [
|
||||
],
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from . import report_stock_forecasted
|
||||
@@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
from odoo import models
|
||||
from odoo.tools.float_utils import float_repr
|
||||
|
||||
|
||||
class ReplenishmentReport(models.AbstractModel):
|
||||
_inherit = 'report.stock.report_product_product_replenishment'
|
||||
|
||||
def _compute_draft_quantity_count(self, product_template_ids, product_variant_ids, wh_location_ids):
|
||||
""" Overrides to computes the valuations of the stock. """
|
||||
res = super()._compute_draft_quantity_count(product_template_ids, product_variant_ids, wh_location_ids)
|
||||
domain = self._product_domain(product_template_ids, product_variant_ids)
|
||||
svl = self.env['stock.valuation.layer'].search(domain)
|
||||
currency = svl.currency_id or self.env.company.currency_id
|
||||
value = float_repr(sum(svl.mapped('value')), precision_digits=currency.decimal_places)
|
||||
if currency.position == 'after':
|
||||
value = '%s %s' % (value, currency.symbol)
|
||||
else:
|
||||
value = '%s %s' % (currency.symbol, value)
|
||||
res['value'] = value
|
||||
return res
|
||||
@@ -0,0 +1,13 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<odoo>
|
||||
<template id="stock_account_report_product_product_replenishment" inherit_id="stock.report_replenishment_header">
|
||||
<xpath expr="//div[@name='pending_forecasted']" position="after">
|
||||
<div t-attf-class="mx-3 text-center">
|
||||
<div class="h3">
|
||||
<t t-esc="docs['value']"/>
|
||||
</div>
|
||||
<div>On Hand Value</div>
|
||||
</div>
|
||||
</xpath>
|
||||
</template>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user