Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
erp5 erp5
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Labels
    • Labels
  • Merge requests 140
    • Merge requests 140
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Jobs
  • Commits
Collapse sidebar
  • nexedi
  • erp5erp5
  • Merge requests
  • !236

Merged
Created Feb 22, 2017 by Jérome Perrin@jeromeOwner

accounting: fix accounting period constraint with node acquisition on invoices

  • Overview 13
  • Commits 1
  • Changes 2

from commit message

We have a constraint preventing closing accounting periods if there are still some accounting transactions that are in "current states" (ie. not delivered / cancelled), but this constraint should not be fooled by accounting lines in stock table that does not have an account as node, but just an acquired organisation.

We already fixed another problem where such lines where "getting in the way" in c61cde5b

But here, it's at inventory level, we want to get "all accounting movements from this section during the period"., excluding these "not really accounting" lines.

I used the same approach as the one we applied when we discovered in !215 (merged) , there was code doing: getInventoryList(node_category="account_type") as a way to get only movements on accounts, relying on the facts that accounts have an account type category. This stopped working and we accepted it because this use case was not really valid. Instead, we did a first query getting all account and passing this as a getInventory(node_uid=

I don't think we want to support node_portal_type in Inventory API, because the concept of portal_types does not really belong in Inventory API to me.

To prevent creating many portal types (Tax, Discount etc) we concluded:

  • Resources (and Movements) are classified by their use category
  • Deliveries are classified by their ledger category
  • Nodes are classified by their role category

So the "pure" approach is maybe to add a role category on all accounts and query inventory with getMovementHistoryList(node_category="role/accounting_node").

I'd say let's merge this for now, but if you have better idea or anything to add please go ahead, I wanted to create an open place for discussion and explaining why i did all this.

/cc @tc @vpelletier @georgios.dagkakis @Nicolas

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Source branch: fix/accounting_period_constraint_vs_acquired_node
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7