Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1697 Add row style change #1908

Closed

Conversation

yamelsenih
Copy link
Member

@yamelsenih yamelsenih commented Aug 17, 2018

Hi Guys We have a new feature for add style for rows in ADempiere, please review it.

Issues:

This project is created for define distinct field style.

The ADempiere field is very static and it does not show distinct behavior when exist important values for end user.

With field style definition a user will can see a field with a distinct Style if a little condition is apporved, example:

We want change color of Document No when delivered quantity is less of ordered quantity

Document No Quantity Order Quantity Delivered
🔴#1 10 5
🔵#356 15 15

Here is the E-R Diagram:
changestyledefinition

@marcalwestf
Copy link
Collaborator

Hi @yamelsenih how would the different configuration scenarios look like?
Thanks

feature/adempiere#1697-Add-Row-Style-Change

Conflicts:
	base/src/org/compiere/model/GridField.java
	base/src/org/compiere/model/GridFieldVO.java
	zkwebui/WEB-INF/src/org/adempiere/webui/component/GridPanel.java
	zkwebui/WEB-INF/src/org/adempiere/webui/component/GridTabRowRenderer.java
@marcalwestf
Copy link
Collaborator

Names and sequences don't match:
File 04000_1697_AddColumnFieldDefinition.xml has SeqNo="3790". It should be 4000.
File 04010_1697_AddWindowFieldDefinition.xml has SeqNo="3800". It should be 4010.

@marcalwestf
Copy link
Collaborator

...also in 04000_1697_AddColumnFieldDefinition.xml the reference to the issue is missing.

@marcalwestf
Copy link
Collaborator

Testing on a seed database up to 03910_1704_FixedAssetBalanceSmartBrowser.xml.

XML 04000_1697_AddColumnFieldDefinition.xml loaded and applied.

XML 04010_1697_AddWindowFieldDefinition.xml loaded, but when applied, the following error message appears:
20180827_windowcolumnfielddefinition_01

Haven't found the cause yet, but I suppose -it has happened already in older XMLs- that when defining columns which later are used for window definitions, in the window definition the column is not known because the commit is issued at the end of the XML.

The error here pops up when as a consequence of the unknown reference, the step is rolled back, but fails because is is already referenced.

Will see into it later and report.

@marcalwestf
Copy link
Collaborator

... it requires the Quick Entry XMLs....so the earliest XML has to be 03921_1088_Add_Column_IsQuickEntry.xml

@marcalwestf
Copy link
Collaborator

marcalwestf commented Aug 27, 2018

The migration of file 04010_1697_AddWindowFieldDefinition.xml works by splitting it in two parts:

  • the first part from step 10 to 360, which includes definition of Element and Column
  • the second part from step 370 to 1360.

Confirming the previously stated supposition: when defining a column which is later used in the window definition (AD_Window), the XML defining column and field has to be splitted in a column definition section and a field definition section.

@marcalwestf
Copy link
Collaborator

After executing the XMLs, a field is displayed in the Application Dictionary, at the "Field" tab of any Window definition:
20180827_windowcolumnfielddefinition_04a

But it is not possible to zoom it (the zoom icon is dim), because in the table AD_FieldDefinition, there is no window defined for this table. The table has to be configured to be related to the window as the following image depicts:
20180827_windowcolumnfielddefinition_05a

After correcting the table, the zoom icon is eligible. However, when selecting the zoom icon, an error message is displayed:
20180827_windowcolumnfielddefinition_06

.... looking at the role definition for SystemAdministrator, the window Field Definition is not allowed:
20180827_windowcolumnfielddefinition_07a

Once that done, the window Field Definition is displayed and edited:
20180827_windowcolumnfielddefinition_08

@marcalwestf marcalwestf added the 14 Waiting for User Changes Waiting for Pull request User make changes label Aug 27, 2018
@marcalwestf
Copy link
Collaborator

... now at last, I can proceed to test...

@marcalwestf
Copy link
Collaborator

This is how the window Field Definition looks like:
20180827_windowcolumnfielddefinition_09

Observations:

  • How does the condition have to look like?
    Is it an SQL? Can the environment syntax be used? etc. etc.
  • Same with stylesheets: which can be used?
    A good starter good be to enumerate the possible choices in the help section of the window definition.

@marcalwestf
Copy link
Collaborator

..when trying to save a condition, this is the result:
20180827_windowcolumnfielddefinition_10

And the error at the console:

===========> MSequence.getNextID: No record found - AD_FieldCondition [18]
===========> MFieldCondition.saveNew: No NextID (-1) [18]
-----------> GridTable.saveWarning: SaveError - [18]

I suppose the sequence was not created.

@marcalwestf
Copy link
Collaborator

and a last observation: it would be of great help it there was an example for GardenWorl of how to use it.

@marcalwestf
Copy link
Collaborator

here an example of how the configuration goes, kindly provided by Nicolas Lopez ( @niclopup ) : https://www.youtube.com/watch?v=8xS04fCx5Rg&feature=youtu.be

@marcalwestf marcalwestf changed the title Feature/#1697 add row style change #1697 Add row style change Sep 29, 2018
@SusanneCalderon
Copy link
Collaborator

Hi @yamelsenih
I have 2 observations:

  • The XML 04010_1697_AddWindowFieldDefinition.xml creates en error at seqNO 350. When you move the steps =>350 into a new migrationfile it runs without problems.

  • The tables AD_FieldDefinition and AD_FieldCondition have entitytype spinConstribution, which has modelpackage org.spin.model. The classes MFieldCondition and MFieldDefinition are generated in package org.compiere.model, which leads to the error classnotfound.

Correcting these points everything runs without problems.

@SusanneCalderon
Copy link
Collaborator

Example: Name of Business Partner is red when open amount > 500
imagen

@yamelsenih
Copy link
Member Author

Hi @SusanneCalderon i will change it, thank you for it revision

@yamelsenih
Copy link
Member Author

I will to create a new Pull request for habdle a clear commit

@yamelsenih
Copy link
Member Author

Please see it #2055

@yamelsenih yamelsenih closed this Oct 4, 2018
e-Evolution pushed a commit to e-Evolution/adempiere that referenced this pull request Oct 7, 2018
e-Evolution added a commit to e-Evolution/adempiere that referenced this pull request Oct 18, 2018
* release/3.9.1: (159 commits)
  adempiere#2074 Bug when try launch a jasper report print format from any Tab adempiere#2074
  adempiere#1722 Enhancement Payroll Send Mail when trying to send the document payroll payment voucher adempiere#1722 - Restore original class and create new SendPayrollReceiptByEmail
  adempiere#1722 Enhancement Payroll Send Mail when trying to send the document payroll payment voucher adempiere#1722
  adempiere#1697, Add improvements for source code, reference to issue: adempiere#1908
  adempiere#1697, Add changes for field definition, reference to issue: adempiere#1697
  adempiere#1975 ZK Process Panel KeyListener remains active when window is no longer visible.  Key listener removed.  OK button setFocus() method used to trap enter key.
  adempiere adempiere#2059 Process Parameters: NPE for reference type Search
  adempiere adempiere#2031 Field LandedCostType in LandedCost
  adempiere adempiere#2031 Field LandedCostType in LandedCost adempiere#2031
  adempiere: adempiere#1918 ReverseAccrual_CostDetForMMatchInv_OR_MMatchPONotFound
  adempiere adempiere#1918 ReverseAccrual_CostDetailForMMatchInv_MMatchPO_Not_Found adempiere#1918
  adempiere: adempiere#1918 ReverseAccrual_CostDetail_MMatchInv_MMatchPO_Not_Found adempiere#1918
  adempiere adempiere#1918 everseAccrual_CostDetailMatchINV/MMatchPO_Not_Found adempiere#1918
  adempiere adempiere#1916 ReverseAccrual generates wrong seqNo in costdetail adempiere#1916
  adempiere#1912 Bug fixes for landedCost and LandedCostAllocation adempiere#1912 from pull request adempiere#1915 from SusanneCalderon/bugfix/Issue1912_LandedCostAllocation_CreateCostDetail
  adempiere adempiere#1555 BankTransfer: Voiding Payments
  adempiere adempiere#1555 BankTransfer: Voiding Payments
  adempiere:  adempiere#1555 BankTransfer: Voiding PaymentsBankTransfer
  adempiere#1676 Enhancement adds a new action to generate a manufacturing order from a project line. adempiere#1676
  Add same change to the new value in case of triggered changes that set the new value before the save.  Improve the comments.
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants