accounts renamed to ledger_accounts from now on

This commit is contained in:
Priec
2026-08-17 19:07:36 +02:00
parent d3b2f14fd2
commit 444ca26d47
10 changed files with 16 additions and 16 deletions

View File

@@ -45,7 +45,7 @@ const PROFILE_ONLY_TYPES: [&str; 2] = [ACCOUNTING_FIELD_TYPE, ACCOUNTING_TRANSFE
/// The profile's chart of accounts. A row reaches it through an ACCOUNTING
/// definition row, never through a link declared by hand.
pub(crate) const ACCOUNTS_TABLE: &str = "accounts";
pub(crate) const LEDGER_ACCOUNTS_TABLE: &str = "ledger_accounts";
const TYPE_DISPLAY_ORDER: &[&str] = &[
"text",
@@ -883,7 +883,7 @@ impl ColumnDraft {
column_type: &str,
) -> Option<String> {
let target = link_target(column_type)?;
if target == ACCOUNTS_TABLE {
if target == LEDGER_ACCOUNTS_TABLE {
return Some(crate::tr!(locale, "schema-err-account-link"));
}
(!self.table_name.is_empty() && target == self.table_name).then(|| {
@@ -1232,7 +1232,7 @@ pub(crate) const RESERVED_TABLE_NAMES: [&str; 5] = [
"general_ledger",
"journal_lines",
"quantity_ledger",
ACCOUNTS_TABLE,
LEDGER_ACCOUNTS_TABLE,
"custom_exchange_rates",
];
@@ -1626,7 +1626,7 @@ pub(crate) mod tests {
generated_column("credit", "money", true),
// The foreign key to the profile's accounts, which the
// backend reports with the rest of them.
generated_column("account", "link(accounts)", false),
generated_column("account", "link(ledger_accounts)", false),
],
..compound("accounting")
},
@@ -2344,7 +2344,7 @@ pub(crate) mod tests {
let mut draft = draft();
draft.name_input = "posted_to".to_string();
draft.type_input = "link".to_string();
draft.link_table_input = ACCOUNTS_TABLE.to_string();
draft.link_table_input = LEDGER_ACCOUNTS_TABLE.to_string();
let error = draft.add_from_inputs(crate::i18n::Locale::default()).unwrap_err();
assert!(error.contains("built into ACCOUNTING"), "{error}");