Difference between revisions of "Create a custom document class"
From iDempiere en
(Created page with "A "document" in iDempiere is an application concept that is very useful. Many of iDempiere's built in functions use documents for its implementation. Examples of documents are...") |
|||
| Line 16: | Line 16: | ||
* Create a new Model (will be explained more in detail) | * Create a new Model (will be explained more in detail) | ||
** Except for the other mandatory fields the model must contain the following fields | ** Except for the other mandatory fields the model must contain the following fields | ||
| − | ** C_DocType_ID numeric(10,0) NOT NULL DEFAULT 0::numeric | + | ** C_DocType_ID numeric(10,0) NOT NULL DEFAULT 0::numeric (Reference = Table, Reference Key = C_DocType) |
** C_DocTypeTarget_ID numeric(10,0) NOT NULL DEFAULT 0::numeric | ** C_DocTypeTarget_ID numeric(10,0) NOT NULL DEFAULT 0::numeric | ||
| − | ** DocAction character varying(2) NOT NULL DEFAULT 'CO'::bpchar | + | ** DocAction character varying(2) NOT NULL DEFAULT 'CO'::bpchar (Reference = Button, Process = Custom Workflow, Reference Key = _Document Action) |
** DocStatus character varying(2) NOT NULL DEFAULT 'DR'::character varying | ** DocStatus character varying(2) NOT NULL DEFAULT 'DR'::character varying | ||
** DocumentNo character varying(30) NOT NULL | ** DocumentNo character varying(30) NOT NULL | ||
| Line 26: | Line 26: | ||
* Generate the model class | * Generate the model class | ||
* The model class must implement DocAction. | * The model class must implement DocAction. | ||
| + | |||
| + | === Create Custom Workflow === | ||
| + | * Create Workflow | ||
| + | * Create Node (DocComplete) | ||
| + | ** Action = Document Action | ||
| + | ** Document Action = Complete | ||
| + | * Create Node (DocPrepare) | ||
| + | ** Action = Document Action | ||
| + | ** Document Action = Prepare | ||
| + | ** Create Transition. Next Node = (DocComplete) | ||
| + | * Create Node (Start) | ||
| + | ** Action = Wait (Sleep) | ||
| + | ** Create Transition. Next Node = (DocPrepare) | ||
| + | * Go back to workflow and select Start Node = (Start) | ||
| + | * Set Workflow Type = Document Process | ||
| + | * Table = same table as the model. | ||
Revision as of 11:42, 9 December 2013
A "document" in iDempiere is an application concept that is very useful. Many of iDempiere's built in functions use documents for its implementation. Examples of documents are:
- Invoices
- Shipments
- Inventory moves/adjustments
- Payments
What makes documents special from other entities (such as business partners / products) are that they have a document status.
The document status enables the documents to be in a workflow and be in different statuses.
This concept is very powerful and the possibility to create new custom documents makes iDempiere even more powerful and flexible.
Steps to create a new custom document
- Create a new Model (will be explained more in detail)
- Except for the other mandatory fields the model must contain the following fields
- C_DocType_ID numeric(10,0) NOT NULL DEFAULT 0::numeric (Reference = Table, Reference Key = C_DocType)
- C_DocTypeTarget_ID numeric(10,0) NOT NULL DEFAULT 0::numeric
- DocAction character varying(2) NOT NULL DEFAULT 'CO'::bpchar (Reference = Button, Process = Custom Workflow, Reference Key = _Document Action)
- DocStatus character varying(2) NOT NULL DEFAULT 'DR'::character varying
- DocumentNo character varying(30) NOT NULL
- processed character(1) DEFAULT 'N'::bpchar
- processing character(1) DEFAULT 'N'::bpchar
- isapproved character(1) NOT NULL DEFAULT 'Y'::bpchar
- Generate the model class
- The model class must implement DocAction.
Create Custom Workflow
- Create Workflow
- Create Node (DocComplete)
- Action = Document Action
- Document Action = Complete
- Create Node (DocPrepare)
- Action = Document Action
- Document Action = Prepare
- Create Transition. Next Node = (DocComplete)
- Create Node (Start)
- Action = Wait (Sleep)
- Create Transition. Next Node = (DocPrepare)
- Go back to workflow and select Start Node = (Start)
- Set Workflow Type = Document Process
- Table = same table as the model.
