Initial commit: Accounting packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:47 +02:00
commit 4ef34c2317
2661 changed files with 1709616 additions and 0 deletions

View file

@ -0,0 +1,30 @@
/** @odoo-module **/
import { patch } from '@web/core/utils/patch';
import { ForecastedHeader as Parent } from "@stock/stock_forecasted/forecasted_header";
export class StockAccountForecastedHeader extends Parent{}
patch(Parent.prototype, 'stock_account.ForecastedHeader', {
async _onClickValuation() {
const templates = this.props.docs.product_templates_ids;
const variants = this.props.docs.product_variants_ids;
const context = Object.assign({}, this.context);
if (templates) {
context.search_default_product_tmpl_id = templates;
} else {
context.search_default_product_id = variants;
}
return this.action.doAction({
name: this.env._t('Stock Valuation'),
res_model: 'stock.valuation.layer',
type: 'ir.actions.act_window',
view_mode: 'list,form',
views: [[false, 'list'], [false, 'form']],
target: 'current',
context: context,
});
}
});
StockAccountForecastedHeader.template = 'stock_account.ForecastedHeader';

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<templates id="template">
<t t-name="stock_account.ForecastedHeader" owl="1" t-inherit="stock.ForecastedHeader" t-inherit-mode="extension">
<xpath expr="//h6[@name='product_variants']" position="after">
<h6 t-if="() => env.user.has_group('stock.group_stock_manager')">
Value On Hand:
<a href="#" class="o_report_open_valuation_report"
t-out="props.docs.value"
t-on-click.prevent="_onClickValuation"/>
</h6>
</xpath>
</t>
</templates>

View file

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-inherit="stock.InventoryReport.Buttons" t-inherit-mode="extension" owl="1">
<xpath expr="//button[hasclass('o_button_at_date')]" position="after">
<button t-if="props.resModel == 'stock.valuation.layer'" type="button"
class="btn btn-primary o_button_at_date me-2" t-on-click="onClickInventoryAtDate">
Valuation at Date
</button>
</xpath>
</t>
</templates>