accountant_cn

This commit is contained in:
2026-11-17 17:57:08 +08:00
parent 9b924747c5
commit 5fc4382687
771 changed files with 18102 additions and 820280 deletions

View File

@@ -0,0 +1,39 @@
/** @odoo-module **/
/**
* DN Financial Reports — one amount cell.
*
* A component of its own rather than an inline `<td>` in the row template, so
* that a cell re-renders only when its own value changes. On a balance sheet
* with 300 accounts and two comparison columns that is 900 cells; keeping them
* as separate components is what stops a fold from repainting all of them.
*
* All the decisions live in `DnFrCell` (see `dn_fr_model.js`); this component
* is deliberately thin and only maps the model onto markup.
*/
import { Component, computed, t, useProps } from "@odoo/owl";
import { COMPARISON_MODE } from "./dn_fr_model";
export class DnFrLineCell extends Component {
static template = "dn_financial_reports.DnFrLineCell";
props = useProps({
cell: t.object(),
});
/** The styling hooks, recomputed only when the value itself changes. */
classes = computed(() => {
const classes = this.props.cell.cssClass;
switch (this.props.cell.comparisonMode) {
case COMPARISON_MODE.MUTED:
return `${classes} muted`;
case COMPARISON_MODE.RED:
return `${classes} text-danger`;
default:
return classes;
}
});
get name() {
return this.props.cell.name;
}
}