Anybody out there want to help me fix bug 1513023 ? And by help, I mean do all the work... It would be worth a lot for me to get this one fixed. I'm willing to pony up a minumum of USD $300 to anyone who can give me a patch I can apply. If it requires more work than that contact me.
This is totally driving me nuts! And I'm really unfamiliar with java/compiere UI stuff.
The problem here is the "context" value for the warehouse is being changed when you select Replenish window... even if you don't change anything!
Initially when you enter the Product window there is no context value set for warehouse_id... so when you press the locator button to select a locator since no warehouse is set it looks up all locators. But one you switch to the Replenish window regardless of whether you change anything or not new fields are added to the context. One of which is the warehouse_id, and the value of this field will be whatever is the currently selected warehouse on the Replenish tab. So if there were two rules
1st = HQ warehouse
2nd = Store warehouse
If you click on the replenishment tab an immediately switch to back .. the HQ warehouse_id is added to the context. Now when you do a lookup on the locators there are only locators from HQ. If on the Replenish tab you scrolled to the Store replenishment rule and returned (as you do in your example)... then only locators in the Store warehouse would be available.
The reason the records already set are modified is because ... the product record holds the locator_id and the UI takes that ID does a look and returns the locator name. But as you scroll through the product records the warehouse_id (being no longer null) is added the selection criteria to lookup the locator name... since that locator is not in the warehouse NULL is returned and the record is updated accordingly! :-(
Now like you I don't know a whole lot about the the UI code.
I hope this explains why we get the functionality we do ... perhaps someone can explain what we need to change to fix it...
Hi Chris, this is a Compiere bug very difficult to fix, as Colin noted it's related with context variables.
Compiere fills and uses FIELD VALUES as CONTEXT WINDOW variables. Given that fields are related to tabs, not windows, I think that FIELD VALUES must be related to CONTEXT WINDOW+TAB variables. But this is a big problem to fix because of the collateral effects.
In fact, I suffered of this problem before navigating to a tab with Processed=Y field -> All window becomes readonly after context variable Processed=Y is filled !!!!
I found a workaround to fix your problem, I just sent you detailed instructions to your e-mail, the summary instructions are these:
- Create a virtual column M_Warehouse_ID for Product table with SQL=null
- Create a field on Product window, Product tab, with the virtual column M_Warehouse_ID, displayed=N
Carlos Ruiz - globalqss
While I hadn't noticed this problem until Chris raised it this was something that would effect my installation too.
So I have spent all afternoon tracking down how the UI fills the data to try and over come it. Amd I came to the conclusion that I had to choices ...
1) rewrite the core UI classes to make the "context" specific to level of tab rather than window. A BIG task and it would cause a huge amount of problems as many tabs requires the information of the other tabs; the Order lines need to know the Order Header ID for a simple example.
2) rewrite the Locator lookups to ignore the warehouse value. But this functionality is extremely useful so I didn't want to do this
3) rename the M_Warehouse_id field in M_Replenishment table... however this could cause problems in the lookup of the Warehouse as it would break the compiere PO system whereby the M_Entity table has the key M_Entity_ID.
So I had just about given up ... but your virtual field idea is great!
Hi Colin, I was thinking on the 1) solution ( rewrite the core UI classes to make the "context" specific to level of tab) and it's not feasible because a lot of windows depends on values of master tabs, in fact, I believe master-detail replication of join key is done this way.
Maybe one definite solution can be "clear" context variables related to fields on the tab ONLY when navigating to a tab of superior level.
I agree with your conclusions for 2) and 3).
> Is it something you could quickly explain?
When navigating to a tab Compiere fills context variables for each field on that tab with the corresponding value.
So when you navigate to the Replenishment tab, context variable M_Warehouse_ID is filled with the value of the field on replenishment tab.
The trick here is that when you navigate to Product tab again, context variable is filled with the value of field M_Warehouse_ID of the product table = null according to the virtual column.
Note that when a context variable becomes null is cleared from the context.
And note that Compiere fills context variables for fields even if they aren't displayed.
Hi Carlos ... it's me again!
When I read virtual column in your reply - I initially thought aha a virual column to in effect rename the M_warehouse_id field on the replenishment tab... as I mentioned I considerd as a possible solution. But then I read your suggestion correctly and saw you meant to create this could in the product table and not the replenishment table. Well I did as you suggested and it does work, but I cannot figure out why? :-) Is it something you could quickly explain? It would save me a lot more debugging time!
thank you... yet again! :-) all is clear now!
with kind regards,
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.