Bug 41214: (QA follow-up): Tidy fix

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2026-01-13 09:21:59 +00:00 committed by Lucas Gass
parent 76d7a0bc72
commit ab14eb2bca
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
4 changed files with 22 additions and 11 deletions

View File

@ -45,9 +45,7 @@
:id="getElementId"
type="checkbox"
v-model="resource[attr.name]"
:changeMethod="
attr.onChange && attr.onChange.bind(this, resource)
"
:changeMethod="attr.onChange && attr.onChange.bind(this, resource)"
:disabled="disabled"
/>
</template>

View File

@ -116,10 +116,11 @@ export default {
let columnActions = thisResource.tableOptions.actions;
const columns = resourceAttrs.reduce((acc, attr, i) => {
const shouldFieldBeHidden = attr.hideIn && typeof attr.hideIn === "function" ? attr.hideIn() : attr.hideIn
if (
shouldFieldBeHidden && shouldFieldBeHidden.includes("List")
)
const shouldFieldBeHidden =
attr.hideIn && typeof attr.hideIn === "function"
? attr.hideIn()
: attr.hideIn;
if (shouldFieldBeHidden && shouldFieldBeHidden.includes("List"))
return acc;
if (
attr.hasOwnProperty("tableColumnDefinition") &&

View File

@ -422,7 +422,10 @@ export default {
relationshipAPIClient: APIClient.cash.cash_registers,
relationshipOptionLabelAttr: "name", // attr of the related resource used for display
relationshipRequiredKey: "cash_register_id",
hideIn: () => sysprefs.value.UseCashRegisters !== "0" ? ["List"] : ["Form", "Show", "List"],
hideIn: () =>
sysprefs.value.UseCashRegisters !== "0"
? ["List"]
: ["Form", "Show", "List"],
group: "Details",
toolTip: __(
"Only required if system preference UseCashRegisters is enabled"

View File

@ -419,11 +419,20 @@ export function useBaseResource(resourceConfig) {
relationshipField.relationshipName = ra.name;
});
}
const shouldFieldBeHidden = ra.hideIn && typeof ra.hideIn === "function" ? ra.hideIn() : ra.hideIn
if (shouldFieldBeHidden && !shouldFieldBeHidden.includes(component)) {
const shouldFieldBeHidden =
ra.hideIn && typeof ra.hideIn === "function"
? ra.hideIn()
: ra.hideIn;
if (
shouldFieldBeHidden &&
!shouldFieldBeHidden.includes(component)
) {
return [...acc, ra];
}
if (shouldFieldBeHidden && shouldFieldBeHidden.includes(component)) {
if (
shouldFieldBeHidden &&
shouldFieldBeHidden.includes(component)
) {
return acc;
}
return [...acc, ra];