From ADempiere
Revision as of 05:56, 3 October 2012 by Omidp (Talk)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
This Wiki is read-only for reference purposes to avoid broken links.
Name This user real name is : Omid Pourhadi
Sourceforge logo.png This user has a Sourceforge account.
Wikipedia logo.png This user has a Wikipedia account.


About Me

my website

Iran Localization

Quotes i like

Omid's projects based on ADempiere

Project 0 (area: Localization and Translation)

  • Adding Persian Calendar
  • Translation

Project 1 (Bounced cheque)

A bounced cheque or RDI (returned deposit item) is a cheque that is returned to the depositing bank because the owner of the account in the issuing bank has insufficient funds to cover its value, has issued a stop payment on the cheque, or their account has been closed or is frozen/limited. In the United States, usually the cheque writer's bank and the other bank charge the cheque writer a penalty for the transaction, and in some instances the writer can be charged with a criminal action. cheque

  • Account : 12120-A/R Non Sufficient Funds Returned Checks

Project 2 (area: LandedCost)

Implement cost ditribution


change getbase method => getbase(args0,int invoiceId)

Minvoice invoice=new Minvoice(getCtx(),invoiceId,trx_Name)
MinvoiceLine[] lines=invoice.getLines(false);
for(int i=0;i<lines.length;i++){
   if(lines[i].getMinoutlineid == get_MinoutLineId()) // check receipt line is equal to invoice line
       return lines[i].getlineNetAmt();

Formula : base * LineNetAmt / total

Project 3 (area: Enhancement)

  • Adempiere on Open Swing

Project 4 (area: Solar Fiscal)

Project 5 (area: Adempiere new Platform)

  • Hibernate 3, JPA

Project 6 (Manufacturing)

  • Manufacturing Resource : IsManufacturingResource Tick + ManufacturingResourceType = Plant
  • [1] Bug Fix


Distribution Resource Planning

Manufacturing Resource Planning

Libero MRP II to ADempiere

Capacity Planning

Supply Chain

Operation Management

Libero FAQ


Libero Test Plan

Project 7 (Adempiere Sales Forecast)

  • [2]Adempiere sf with loaked

Project 8 (Adempiere CRM)

  • try to integrate open source crm like opentaps with adempiere


Adding new Language

System Admin >> General Rules >> System Rules >> Language
  • check system language
  • Add Missing Translation ( click on Language maintenance ) in Language window
  • Export Language
  • After translation Import Xml files
  • Synchronize Terminology
  • Hint: Exporting translation need to define client and system
  • imp Trl

Delete Garden Client

Create New LAF

Info Class Factory

Adempiere Coding guidline

Window Tree Structure

  • [3] Save tree structure in window

Set to context

Env.setContext(Env.getCtx(), "#AD_Client_ID", 1000000);

Dynamic Context

String dynDocType = WindowNo  + "|C_DocType_ID"; 
int C_DocType_ID = Env.getContextAsInt(Env.getCtx(), dynDocType);

Set Value To DB Column

MBPartner bp = new MBPartner(Env.getCtx(), 0, null);
bp.set_ValueOfColumn("AD_Client_ID", client_id);

Awesome Features

Functionality Tips on sf and wiki

How Cost centers are implemented in Adempiere? post Adempiere support cost center using organization setup( have a look at the organization and organization type setup). Also, the transact organization element could be turned on in accounting schema to handle this.

Budgeting in Adempiere post

Cash Flow


Sales Forecast


How to Limit User Access to own Record

Limit Records

Adempiere Development

  • [4] create your development env
  • [5] Tutorials
  • [6] customizing proj

SQL Statement

ALTER SCHEMA omid RENAME TO adempiere;
SELECT sqlj.install_jar('file:///....', 'sqlj', true);
ALTER SCHEMA adempiere RENAME TO omid;
SELECT sqlj.set_classpath('omid', 'sqlj');

Receipt VS Return Material

  • table name = m_inout
  • window = material receipt
document type = MM Receipt, MM Return 
Movement Type = V+ 
  • table name = m_inout
  • window name : shipment
document type = MM Shipment, MM vendor Return 
Movement type = -C
  • table name = m_inventory and join with c_doctype
  • window name : Internal use , physical inventory
document type : physical inventory
  • window name : inventory move
document type : Material physical inventory (Material Movement)

Movement type

  • Customer Returns :
  • Customer Shipment : shipment window
  • Inventory In : physical inventory
  • Inventory Out :
  • Movement From : Inventory move
  • Movement To : Inventory move
  • Production - :
  • Production + :
  • Vendor Receipts : material receipt = MM Receipt, MM return
  • Vendor Returns :
  • Work Order - :
  • Work Order + :

DB and java and ad

  • tablename : m_transaction
  • List Reference : M_Transaction Movement Type


Hint :

  • qty/dividedRate = base unit
  • qty*multipleRate = base unit

Install Adempiere on IBM java

My Patches & Contributions in Adempiere


  • [7] Add Iran Cities
  • [8] Add iran states
  • [9] JBPM Integration

I think this is usefull for logistic Patches i submited

  • [10] Designing java form with netbeans in adempiere
  • [11] Fix Right to Left
  • [12] Amount in Words (Farsi Version)
  • [13] Fix Move Confirmation window
  • [14] Cash Payment
  • [15] Sequence Column for report
  • [16] sql operation condition
  • [17] new look and feel

Template Process and steps to create a process

Adempiere Accounting

  • [18] Accounting
  • [19] COA
  • FA
  • Account Schema window is very impoertant to basic setup Accounting

Cash generated from customers


Cash paid to suppliers


Posting Account in src

  • [20] specific account

How To Add Different Accounts To COA

Generate Model

Creating Batch file for generate model

  • Create C:\Adempiere\model\ Folder
ECHO Model is generating
java -cp %ADEMPIERE_HOME%\lib\Adempiere.jar;%ADEMPIERE_HOME%\lib\AdempiereCLib.jar;
%ADEMPIERE_HOME%\lib\CSTools.jar org.compiere.util.GenerateModel C:\Adempiere\model\ 
org.compiere.model 'U'
  • Rules fro generating MClass and XClass
X_Class automatic generate by generatemodel file that has different type like 'U' or 'D'
for generating MClass if your table name has less than 3 letters before underline ( _ )
mclassname is M + cut tablename after underline like ZZ_WF => MWF
but if your table name has more than 3 letters
before underline like CUS_Omid your model class name is MCUSOmid (M + TableName without _ ) 

WorkFlow (Wf)

Download Wf Reference

/**	Process Message 			*/
	private String		m_processMsg = null;

public String getProcessMsg() {
		// TODO Auto-generated method stub
		return m_processMsg;
public String prepareIt() {
		return DocAction.STATUS_InProgress;
public boolean processIt(String processAction) throws Exception {
		m_processMsg = null;
		DocumentEngine engine = new DocumentEngine (this, getDocStatus());
		return engine.processIt (processAction, getDocAction());
  • your window should be in transaction mode
  • XOR means that only the first valid transition is executed, and

'AND' means all the transitions are executed.

  • Since the 'Std User Workflow' tickbox is ticked ,

this node will ONLY be executed if the Action is 'COMPLETE', and some other conditions which are still undefined in this document. (This has been determined from the source code).

  • and VDocAction fill state of document (complete - void - close - ....)
  • SQL operation in condition not implemented yet
  • load acitivity
SELECT * FROM AD_WF_Activity a WHERE ((a.Processed='N' 
AND a.WFState='OS' ) OR (a.Processed='Y' And a.WFState='CA')) And 
( a.AD_User_ID=102 OR EXISTS 
(SELECT * FROM AD_WF_Responsible r WHERE a.AD_WF_Responsible_ID=r.AD_WF_Responsible_ID 
AND (a.AD_User_ID=102 OR a.AD_User_ID IS NULL)) 
a.AD_WF_Responsible_ID=r.AD_WF_Responsible_ID AND r.AD_User_ID=102) 
INNER JOIN AD_User_Roles ur ON (r.AD_Role_ID=ur.AD_Role_ID) 
WHERE a.AD_WF_Responsible_ID=r.AD_WF_Responsible_ID AND ur.AD_User_ID=102)) 
ORDER BY a.Priority DESC, Created


Set search_path to adempiere,sqlj;
CREATE OR REPLACE FUNCTION adempiere.persiancalendar(gregoriandate timestamp with time zone)
  RETURNS character varying AS
ALTER FUNCTION adempiere.persiancalendar(gregoriandate timestamp with time zone) OWNER TO postgres;
select sqlj.replace_jar('file:///C:/Adempiere/lib/sqlj.jar','sqlj',true )
select persianCalendar(now())

Adempiere Architecture


Adempiere WEB

  • WFieldUpdate
  • window.js
  • Don't choose unicode role WebDoc can not create unicode character to load client
  • use build.xml in serverApps to compile webUI with ant

Adempiere Hints

  • Use negative Qty for Return Material
  • Uncheck Allow Negative Posting
o.IsCentrallyMaintain='N' => o.IsCentrallyMaintain='Y'
  • When you use table refferrence in column Pay attention the System Element MUST ends with _ID to assign it to another

table unless you get error unmatch datatypes if you don't use _ID column becomes String(varchar) else column becomes number

  • when you are creating parent/child window, do not forget to set tablevel for example parent tablevel is zero and child is one

Window Button

  • VCreateFrom => initBPartnerOIS (int C_BPartner_ID, boolean forInvoice)
  • VCreateFromShipment
=> initBPInvoiceDetails(int C_BPartner_ID)
=> initBPRMADetails(int C_BPartner_ID)
  • VCreateFromInvoice => initBPDetails(int C_BPartner_ID)



Omid's Activity

BI (Business Intelligence)

ERP System

Adempiere provides all standard ERP features including Accounting, Sales and Purchase cycle, Inventory management. Adempiere Wiki

Free/OpenSource License: Mozila Public License (MPL) Operating System: All Language:Java Openbravo is the leading fully functional integrated web-based open source enterprise management (ERP) system that offers a unique value proposition - a higher value at a lower cost. OpenBravo Wiki

My Favorite Technology

Jasper Reports

iReport Hints

  • Always set Parameters data type to BigDecimal
  • Everything is case-sensitive

Hobby & Fun

MY wishList

Some java tip

  • Abstract Classes versus Interfaces
  • static: states that the method can be called without an object
  • abstract: implies that the method does not have code, and has to be implemented

in the subclass

  • final: states that the method cannot be inherited or ovveridden
  • Synchronized: used with a method while implementing threads. it permits only one

thread access to a block of code at a time

  • volatile: used with a variable to indicate that the value of variable can be

changed several times during RUNTIME and its value is not store in the registers

  • Overloading and overriding methods: overloaded methods are in the same class

and have the same name but different parameter lists and different types of data overriding methods are in the superclass as well as subclass. overriding allows a general class to specify methods that will be common to its subclasses. e.g a class define general method 'area()' . this method maybe implemented in subclasses to find the area of particular shapes, such as , rectangle or triangle

  • Class Constructor: Explicit constructor

you can code these constructor in the class definition while creating an object of the class Implicit Constructor when you do not define a constructor for class the JVM provides a default or implicit constructor

  • Interfaces:it allows to class to have a several superclass

An interface is used instead of abstract class where there are no implementation or inherit [30]

Interested Project in

this is usefull for creating pdf in createPdf method in DocAction

framework to develop j2ee application need to know java anotation or jpa

Ajax framework. 100% Java, no JavaScript

OpenSwing is a components library that provides a rich set of advanced graphics components for developing desktop applications and HTTP based java applications/RIAs based on Swing front-end.

Jabber Client

Web-Based Document Management System, DMS, written in Java, with a powerful Search Engine - Lucene, Web-Service interface - Axis

This project allows access to USB devices from Java. It was created under the JCP process and is assigned JSR 080. The official Java package name is 'javax.usb'.

This open source software is provided for configuration and loading of device services developed to the JavaPOS architecture and standard

  • [31] JAllInOne ERP/CRM

This application was developed in a few months thanks to Openswing capabilities: this is a development framework that allows to create RIAs with a GUI having very complex contents with low development time.


  • E-Mail: omidpourhadi [AT]
  • Yahoo Messenger: vata2999
  • Skype: vata2999
  • website: