fixes #40 New resource assignment cannot be saved if logged in without org

http://bitbucket.org/idempiere/idempiere/issue/40
This commit is contained in:
Carlos Ruiz 2011-06-16 21:56:58 -05:00
parent f1dc9e783c
commit b85f11d738
2 changed files with 13 additions and 1 deletions

View File

@ -131,6 +131,14 @@ public class WAssignmentEditor extends WEditor {
Integer oldValue = (Integer)getValue();
int S_ResourceAssignment_ID = oldValue == null ? 0 : oldValue.intValue();
MResourceAssignment ma = new MResourceAssignment(Env.getCtx(), S_ResourceAssignment_ID, null);
if (S_ResourceAssignment_ID == 0) {
if (gridField != null && gridField.getGridTab() != null) {
// assign the resource of the document if any
Object org = gridField.getGridTab().getValue("AD_Org_ID");
if (org != null && org instanceof Integer)
ma.setAD_Org_ID((Integer) org);
}
}
// Start VAssignment Dialog
if (S_ResourceAssignment_ID != 0)

View File

@ -530,7 +530,11 @@ public class InfoSchedule extends Window implements EventListener
break;
}
if (slot != null) {
MResourceAssignment ma = new MResourceAssignment(Env.getCtx(), 0, null);
MResourceAssignment ma;
if (m_mAssignment == null)
ma = new MResourceAssignment(Env.getCtx(), 0, null);
else
ma = m_mAssignment;
ma.setS_Resource_ID(S_Resource_ID);
ma.setAssignDateFrom(TimeUtil.getDayTime(start, slot.getStartTime()));