19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:30:07 +01:00
parent ba20ce7443
commit 768b70e05e
2357 changed files with 1057103 additions and 712486 deletions

View file

@ -0,0 +1,16 @@
import { patch } from "@web/core/utils/patch";
import { StockValuationReportController } from "@stock_account/stock_valuation/controller";
patch(StockValuationReportController.prototype, {
async loadReportData() {
const data = await super.loadReportData();
if (this.data.cost_of_production) {
// Prepare the "Cost of Production" lines.
for (const line of this.data.cost_of_production.lines) {
line.account = this.data.accounts_by_id[line.account_id];
}
}
return data;
},
});

View file

@ -0,0 +1,11 @@
import { _t } from "@web/core/l10n/translation";
import { patch } from "@web/core/utils/patch";
import { StockValuationReport } from "@stock_account/stock_valuation/stock_valuation_report";
patch(StockValuationReport.prototype, {
openCostOfProduction() {
return this.openStockMoveView(_t("Cost of Production"), "production");
}
});

View file

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates>
<t t-inherit="stock_account.StockValuationReport" t-inherit-mode="extension">
<xpath expr="//t[@t-call='stock_account.StockValuationReport.InventoryLoss']" position="after">
<t t-if="data.cost_of_production" t-call="mrp_account.StockValuationReport.CostOfProduction"/>
</xpath>
</t>
<t t-name="mrp_account.StockValuationReport.CostOfProduction">
<StockValuationReportLine
label.translate="Cost of Production"
level="0"
displayDebitCredit="true"
onClickMethod.bind="openCostOfProduction"
sublines="data.cost_of_production.lines"
value="data.cost_of_production.value"/>
<t t-call="stock_account.StockValuationReport.EmptyLine"/>
</t>
</templates>