Discussion:
[Erp5-dev] trial balance
Bartłomiej Górny
2006-01-10 15:06:50 UTC
Permalink
Hello

Is there a fix for the "Trial balance" report (throws an AttributeError
"Resource_zGetInventoryOld")? Or somebody working on it?

Or, should I rather put together a new Balance Sheet / P&L account? If
so, what is currently the preferred way to get the state of a Balance
Sheet account?

Bartek
--
"Software is largely a service industry operating under the persistent
but unfounded delusion that it is a manufacturing industry."
Eric S.Raymond, "The Magic Cauldron"
Jérôme Perrin
2006-01-10 15:17:34 UTC
Permalink
Post by Bartłomiej Górny
Hello
Is there a fix for the "Trial balance" report (throws an AttributeError
"Resource_zGetInventoryOld")? Or somebody working on it?
Resource_zGetInventoryOld has finally been removed a few weeks ago.
Currently, Trial Balance uses the inventory API.
Post by Bartłomiej Górny
Or, should I rather put together a new Balance Sheet / P&L account? If
so, what is currently the preferred way to get the state of a Balance
Sheet account?
Definitly, this have to be implemented using the inventory API
( getInventory ), which is accesible from portal_simulation and documented as
docstrings in SimulationTool.py, or you can use localized versions of
erp5_accounting from CVS as an example.
--
J?rome
Bartłomiej Górny
2006-01-14 13:52:36 UTC
Permalink
Post by Jérôme Perrin
Post by Bartłomiej Górny
Or, should I rather put together a new Balance Sheet / P&L account? If
so, what is currently the preferred way to get the state of a Balance
Sheet account?
Definitly, this have to be implemented using the inventory API
( getInventory ), which is accesible from portal_simulation and documented as
docstrings in SimulationTool.py, or you can use localized versions of
erp5_accounting from CVS as an example.
Still having problems - I'm struggling with FiscalReport this time, and
I can getInventory of an account by supplying the accounts uid as
node_uid arg, but what I need is total inventory of the whole gap
subtree - passing gap as node_category (as you do in the French one)
returns 0, I tried several other ways but always got either zero or the
whole inventory from all accounts.

By the way, how to get from portal_catalog all objects that belong to a
subtree of a certain category?

Bartek
--
"Software is largely a service industry operating under the persistent
but unfounded delusion that it is a manufacturing industry."
Eric S.Raymond, "The Magic Cauldron"
Bartłomiej Górny
2006-01-14 16:45:00 UTC
Permalink
Post by Bartłomiej Górny
Post by Bartłomiej Górny
Or, should I rather put together a new Balance Sheet / P&L account? If
so, what is currently the preferred way to get the state of a Balance
Sheet account?
Definitly, this have to be implemented using the inventory API (
getInventory ), which is accesible from portal_simulation and
documented as docstrings in SimulationTool.py, or you can use
localized versions of erp5_accounting from CVS as an example.
Still having problems - I'm struggling with FiscalReport this time, and
I can getInventory of an account by supplying the accounts uid as
node_uid arg, but what I need is total inventory of the whole gap
subtree - passing gap as node_category (as you do in the French one)
returns 0, I tried several other ways but always got either zero or the
whole inventory from all accounts.
By the way, how to get from portal_catalog all objects that belong to a
subtree of a certain category?
Oh, I think I got it:

context.portal_categories.resolveCategory('base/sub').getCategoryMemberItemList(base=0,...)

Is this the right one?

B.
Post by Bartłomiej Górny
Bartek
--
"Software is largely a service industry operating under the persistent
but unfounded delusion that it is a manufacturing industry."
Eric S.Raymond, "The Magic Cauldron"
Jérôme Perrin
2006-01-14 17:36:52 UTC
Permalink
Post by Bartłomiej Górny
Post by Bartłomiej Górny
By the way, how to get from portal_catalog all objects that belong to a
subtree of a certain category?
context.portal_categories.resolveCategory('base/sub').getCategoryMemberItem
List(base=0,...)
Is this the right one?
This one returns a list of items ready for use in a Formulator list field.

The easyiest way for you is to use accessors.
Let's take a simple example, with an Account a belonging to category
account_type/income.

a.getAccountTypeValue(), the standard category accessor, returns the category
object at portal_categories/account_type/income.

In your case, you need related category accessors from this the category
object, like that :

portal_categories.account_type.income.getAccountTypeRelatedValueList( portal_type=Account )

which returns the list of Account object related to that category.

This of course works with all categories (getGapRelatedValueList,
getDestinationRelatedValueList and so on)
--
J?rome
Jérôme Perrin
2006-01-14 17:09:16 UTC
Permalink
Post by Bartłomiej Górny
Post by Jérôme Perrin
Post by Bartłomiej Górny
Or, should I rather put together a new Balance Sheet / P&L account? If
so, what is currently the preferred way to get the state of a Balance
Sheet account?
Definitly, this have to be implemented using the inventory API
( getInventory ), which is accesible from portal_simulation and
documented as docstrings in SimulationTool.py, or you can use localized
versions of erp5_accounting from CVS as an example.
Still having problems - I'm struggling with FiscalReport this time, and
I can getInventory of an account by supplying the accounts uid as
node_uid arg, but what I need is total inventory of the whole gap
subtree - passing gap as node_category (as you do in the French one)
returns 0, I tried several other ways but always got either zero or the
whole inventory from all accounts.
In accounting, getInventory returns the balance of account(s), then it's
pretty normal that the result is 0 unless Debit != Credit in your accounting.
If what you want to do is to extract the debit of all accounts, pass
omit_output = 1 parameter to getInventory, (or omit_input = 1 if you want
credit)
--
J?rome
Loading...