When entity fields are added to account types (via the Managed Fields page), these fields are not available when creating actual accounts.

Comments

coreyp_1’s picture

Attaching patches and screenshots:

Changes proposed to GUI:
Instead of selecting the account type from a drop-down, provide separate pages for each account type, thus allowing the appropriate fields to be displayed. This is analogous to the node module, where different node types are created using different menu paths.

Changes proposed to Schema:
I propose that the field name (the machine name) in the ledger_account_type table be changed to type, which is included in the patch. First, it is consistent with other entity-enabled modules (like node), and secondly, it avoids confusion with ledger_account, where name is the user-friendly name, and type is the machine name. Thirdly, it made the bug easier to track down.

coreyp_1’s picture

Status: Active » Needs review

Bah. I forgot to change the status.

m.stenta’s picture

Makes perfect sense to me! Thanks for the patch! I'll review this ASAP... crunching to prepare for DrupalCon right now. :-D

m.stenta’s picture

Working on reviewing this patch... looks really good for the most part. I changed a few things, and some of your changes spurred other more-global changes that needed to be made (see the commit that comes before this one... when I push it up).

The only part I'm not sure about is the following:

<php
function ledger_account_ui_account_form_wrapper($account, $op) {

  if (!isset($account->aid) && $op != 'create') {
    drupal_access_denied();
  }

  // If an account isn't provided, create a new one.
  if ($op == 'create') {
    $account = ledger_account_new(array('type' => /*'ledger_account', 'bundle' =>*/ $account));
  }
?>

Could you elaborate on this a bit?

m.stenta’s picture

Status: Needs review » Closed (fixed)

I'll close this issue, because the bulk of it is committed. But let's discuss the code in the comment above regardless.

m.stenta’s picture

Issue summary: View changes

Hi @corey_p: I wanted to get your input on the following issue: #2376593: Remove "Account Type" bundles?

We are questioning whether or not it's necessary to have different Account Types with different fields... or if we should collapse them down to a single Account entity type, with a "Type" property for defining what it's fundamental type is (asset, expense, income, equity, or liability).

What do you think? Are you using Account Types with different fields currently?