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

System Element overwrite on Window Field #1752

Closed
metas-mk opened this Issue Jun 8, 2017 · 12 comments

Comments

Projects
None yet
7 participants
@metas-mk
Member

metas-mk commented Jun 8, 2017

Is this a bug or feature request?

Feature Request

What is the current behavior?

Currently, it is possible to define System Elements on Column Level. These can be centrally maintained by the Translation Sync process. If you have generic columns e.g. C_BPartner_ID that can have different meanings depending on isSOTrx then you have to take out centrally maintained and Translate on your own.

Which are the steps to reproduce?

Check and see.

What is the expected or desired behavior?

The concept of System elements is nice but not thought to the end. It would be nice to have a System Element overwrite possibility on Field Level, so one can define Window dependent meanings AND have them centrally maintained.

First rough ideas.

@metas-mk metas-mk added this to the 2017-25 milestone Jun 8, 2017

@teosarca

This comment has been minimized.

Show comment
Hide comment
@teosarca

teosarca Jun 8, 2017

Member

Here are my 2 cents,

  1. Remark that we have AD_Window.IsSOTrx.
    I think, when propagating names & translations from AD_Element/AD_Column to AD_Field, the AD_Window.IsSOTrx shall be considered and in case IsSOTrx=N it shall copy the PO_Name instead of Name. (same for Description and Help).

PS: if the IsSOTrx is not enough we shall come up with a concept which allows defining AD_Element translations for each "functional context". e.g. a C_BPartner_ID might be named differently if it's in Sales, if it's in Purchase, if it's in Subscriptions etc.

  1. We shall check current state and update the IsCentrallyMaintained flags everywhere (because we were not using that flag for a long time).
    After the IsCentrallyMaintained is up2date, i remember there is a window where you can see not translated things (element, field etc). We shall use that to figure out what's pending to be translated.
Member

teosarca commented Jun 8, 2017

Here are my 2 cents,

  1. Remark that we have AD_Window.IsSOTrx.
    I think, when propagating names & translations from AD_Element/AD_Column to AD_Field, the AD_Window.IsSOTrx shall be considered and in case IsSOTrx=N it shall copy the PO_Name instead of Name. (same for Description and Help).

PS: if the IsSOTrx is not enough we shall come up with a concept which allows defining AD_Element translations for each "functional context". e.g. a C_BPartner_ID might be named differently if it's in Sales, if it's in Purchase, if it's in Subscriptions etc.

  1. We shall check current state and update the IsCentrallyMaintained flags everywhere (because we were not using that flag for a long time).
    After the IsCentrallyMaintained is up2date, i remember there is a window where you can see not translated things (element, field etc). We shall use that to figure out what's pending to be translated.

@metas-mk metas-mk self-assigned this Jun 24, 2017

@metas-mk metas-mk modified the milestones: 2017-25, Backlog Jul 16, 2017

@metas-mk

This comment has been minimized.

Show comment
Hide comment
@metas-mk

metas-mk Oct 26, 2017

Member

Had a talk w/ @metas-ts about this. would be great to also have the other translatable elements like window, tab covered by system elements too.

Member

metas-mk commented Oct 26, 2017

Had a talk w/ @metas-ts about this. would be great to also have the other translatable elements like window, tab covered by system elements too.

@teosarca

This comment has been minimized.

Show comment
Hide comment
@teosarca

teosarca Nov 22, 2017

Member

update: Had a talk with mark and we decided to go with the "AD_Element" approach.
Below it's a short concept.


AD_Element:

  • make ColumnName not mandatory
  • introduce "AD_Element_WithColumnName" validation rule which selects only those AD_Element(s) which have the ColumnName not null

AD_Column.AD_Element_ID - use AD_Element_WithColumnName validation rule

AD_Field:

  • introduce AD_Name_ID column, not mandatory, which points to AD_Element table.
    As soon as the user sets it, the AD_Field's Name, Description, Help is copied from that AD_Element. Also the AD_Field_Trl(s) are updated from that AD_Element. In case the AD_Name_ID is not set, it shall work as before (i.e. copied from AD_Column and AD_Column_Trl).
  • drop IsCentralyMaintained flag, we will no longer use it

If user is changing an AD_Element or AD_ELement_Trl, the changes shall be propagated accordingly, i.e. the AD_Field.AD_Name_ID will be considered. See org.compiere.model.M_Element.afterSave(boolean, boolean)

In nearest future we are planning to introduce this AD_Name_ID to AD_Process_Para, AD_Tab, AD_Window etc. But that shall be implemented in other tasks. In this one we are just kick-starting it.

Member

teosarca commented Nov 22, 2017

update: Had a talk with mark and we decided to go with the "AD_Element" approach.
Below it's a short concept.


AD_Element:

  • make ColumnName not mandatory
  • introduce "AD_Element_WithColumnName" validation rule which selects only those AD_Element(s) which have the ColumnName not null

AD_Column.AD_Element_ID - use AD_Element_WithColumnName validation rule

AD_Field:

  • introduce AD_Name_ID column, not mandatory, which points to AD_Element table.
    As soon as the user sets it, the AD_Field's Name, Description, Help is copied from that AD_Element. Also the AD_Field_Trl(s) are updated from that AD_Element. In case the AD_Name_ID is not set, it shall work as before (i.e. copied from AD_Column and AD_Column_Trl).
  • drop IsCentralyMaintained flag, we will no longer use it

If user is changing an AD_Element or AD_ELement_Trl, the changes shall be propagated accordingly, i.e. the AD_Field.AD_Name_ID will be considered. See org.compiere.model.M_Element.afterSave(boolean, boolean)

In nearest future we are planning to introduce this AD_Name_ID to AD_Process_Para, AD_Tab, AD_Window etc. But that shall be implemented in other tasks. In this one we are just kick-starting it.

@metas-ts

This comment has been minimized.

Show comment
Hide comment
@metas-ts

metas-ts Dec 6, 2017

Member

Hi @metas-mk @teosarca @cristinamghita
not sure it belongs here, but could Cristina also locate and comment out the code that updates/overrides
AD_Column.Note and AD_Column.Help from AD_Element? To me it's a major pain.
I would like to e.g. have a C_BPartner_ID column and set it to "Not-Foreign-Key" or "Not-Lazy" and add a short info about it.
wdyt?

Member

metas-ts commented Dec 6, 2017

Hi @metas-mk @teosarca @cristinamghita
not sure it belongs here, but could Cristina also locate and comment out the code that updates/overrides
AD_Column.Note and AD_Column.Help from AD_Element? To me it's a major pain.
I would like to e.g. have a C_BPartner_ID column and set it to "Not-Foreign-Key" or "Not-Lazy" and add a short info about it.
wdyt?

@teosarca

This comment has been minimized.

Show comment
Hide comment
@teosarca

teosarca Dec 6, 2017

Member

@metas-ts IMHO, for that case we would need another column (e.g. InternalNote or something), because Name, Description, Help have other usages.
wdyt?

Member

teosarca commented Dec 6, 2017

@metas-ts IMHO, for that case we would need another column (e.g. InternalNote or something), because Name, Description, Help have other usages.
wdyt?

metas-rc added a commit that referenced this issue Dec 7, 2017

metas-rc added a commit that referenced this issue Dec 7, 2017

metas-rc added a commit that referenced this issue Dec 7, 2017

metas-rc added a commit that referenced this issue Dec 8, 2017

metas-rc added a commit that referenced this issue Dec 8, 2017

#1752 Update is handled in the new interceptor
* No need for the beforeSave method which was doing the same thing
#1752
@metas-rc

This comment has been minimized.

Show comment
Hide comment
@metas-rc

metas-rc Dec 8, 2017

Member

I checked if I can quickly apply my changes in org.compiere.process.SynchronizeTerminology but I couldn't. It's huge, ugly and completely hardcoded.
Please, check if it is still neded and let's drop it if it isn't.

Member

metas-rc commented Dec 8, 2017

I checked if I can quickly apply my changes in org.compiere.process.SynchronizeTerminology but I couldn't. It's huge, ugly and completely hardcoded.
Please, check if it is still neded and let's drop it if it isn't.

metas-rc added a commit that referenced this issue Dec 8, 2017

teosarca added a commit that referenced this issue Dec 20, 2017

temporary add AD_Field.IsCentrallyMaintained
because we still have migration scripts which are created when this
columns was there.

Next week(s) or so, we shall drop it for good.

#1752

metas-ts added a commit that referenced this issue Jan 5, 2018

update releaseNotes
[#768](metasfresh/metasfresh-webui-api#768)
Picking Tray Clearing: packing HUs: generate shipper's package label
[#3281](#3281)
C_Tax.ValidFrom bug
[#3272](#3272) Provide
Periods for 2018
[#741](metasfresh/metasfresh-webui-api#741)
WebUI window C_Printing_Queue broken
[#769](metasfresh/metasfresh-webui-api#769)
New context variable for isWebUI
[#764](metasfresh/metasfresh-webui-api#764)
Receipt candidates: HU editor: cannot call Transform for a CU
[#3237](#3237) New
Document "Source of Supply"
[#1465](metasfresh/metasfresh-webui-frontend#1465)
frontend: Processes: when calling a process frontend shall provide which
are the selected rows in the left/right view
[#3230](#3230) Pharma:
import prices
[#763](metasfresh/metasfresh-webui-api#763)
Picking Tray Clearing: packing HUs: Add to Transportation Order, Ship
and Invoice action
[#2822](#2822) Empty
Country in Price List not working
[#3238](#3238) Create
Missing M_Cost records on the fly
[#1752](#1752) System
Element overwrite on Window Field
[#3233](#3233) WebUI:
Role permission constraints missing in Subtabs
[#757](metasfresh/metasfresh-webui-api#757)
elasticsearch shall use slf4j instead of log4j
[#752](metasfresh/metasfresh-webui-api#752)
Picking Tray Clearing: picking slot filter no results
[#3227](#3227) Attachment
related perf problem in swing client
[#3155](#3155) Create
special pharma import product table
[#3225](#3225) Error on
unclosing a "manually" created PPOrder
[#3222](#3222) refactor
trx event listeners
[#758](metasfresh/metasfresh-webui-api#758)
Picking Tray Clearing: process to take out an HU and add it to existing
HU
[#760](metasfresh/metasfresh-webui-api#760)
Picking Tray Clearing: process to take out an HU and add it to new HU

metas-ts added a commit that referenced this issue Jan 10, 2018

#1752 apply some polish
for the benefit of thick users like myself :-)

System Element overwrite on Window Field #1752

@metas-lc metas-lc self-assigned this Jan 11, 2018

@metas-lc

This comment has been minimized.

Show comment
Hide comment
@metas-lc

metas-lc Jan 11, 2018

Contributor

IT
AD_Field and AD_Field_Trl are updated to what you have in element and element trl only if you add the AD_Name_ID before you save a new ad_field. If you add it after, AD_Field_Trl is not updated anymore. Only AD_Field is updated NOK

Contributor

metas-lc commented Jan 11, 2018

IT
AD_Field and AD_Field_Trl are updated to what you have in element and element trl only if you add the AD_Name_ID before you save a new ad_field. If you add it after, AD_Field_Trl is not updated anymore. Only AD_Field is updated NOK

@metas-ts

This comment has been minimized.

Show comment
Hide comment
@metas-ts

metas-ts Jan 16, 2018

Member

@teosarca i'm not sure if this is really important for this week's RC...do you know something I don't?
@metasnw , do you need it?

Member

metas-ts commented Jan 16, 2018

@teosarca i'm not sure if this is really important for this week's RC...do you know something I don't?
@metasnw , do you need it?

@metas-lc

This comment has been minimized.

Show comment
Hide comment
@metas-lc

metas-lc Jan 16, 2018

Contributor

IT (see 7 and 8)

  1. made an element without column name. Also translated de_CH. Added description and help
  2. added a new column in a table, e.g. testvalue
    => the fields like name, description and help took values from testvalue
  3. press save
  4. go to window and add this new field, press save
    => the fields like name, description and help took values from testvalue
  5. add your element in name id
    => name, description and help are updated
  6. go to field trl and select the one for de_CH
    => it's translated OK
  7. update ad element and ad_element trl
    => ad_field is updated OK
    => ad_field_trl is not updated NOK
  8. delete this new field and add a new one, exactly the same, but add your element before you save
    => field and field trl are translated OK
  9. update ad element and ad_element trl
    => ad_field is updated OK
    => ad_field_trl is not updated NOK
Contributor

metas-lc commented Jan 16, 2018

IT (see 7 and 8)

  1. made an element without column name. Also translated de_CH. Added description and help
  2. added a new column in a table, e.g. testvalue
    => the fields like name, description and help took values from testvalue
  3. press save
  4. go to window and add this new field, press save
    => the fields like name, description and help took values from testvalue
  5. add your element in name id
    => name, description and help are updated
  6. go to field trl and select the one for de_CH
    => it's translated OK
  7. update ad element and ad_element trl
    => ad_field is updated OK
    => ad_field_trl is not updated NOK
  8. delete this new field and add a new one, exactly the same, but add your element before you save
    => field and field trl are translated OK
  9. update ad element and ad_element trl
    => ad_field is updated OK
    => ad_field_trl is not updated NOK
@metasnw

This comment has been minimized.

Show comment
Hide comment
@metasnw

metasnw Jan 16, 2018

Member

@metas-ts I dont need it now

Member

metasnw commented Jan 16, 2018

@metas-ts I dont need it now

@metas-rc

This comment has been minimized.

Show comment
Hide comment
@metas-rc

metas-rc Jan 16, 2018

Member

Update: After we set the sys configs from here http://docs.metasfresh.org/developers_collection/en/getting_started_db_en.html into the db we were testing on and we also got access to the migration script logs folder, the problems did not occur any more. Now the field translations update correctly.

Member

metas-rc commented Jan 16, 2018

Update: After we set the sys configs from here http://docs.metasfresh.org/developers_collection/en/getting_started_db_en.html into the db we were testing on and we also got access to the migration script logs folder, the problems did not occur any more. Now the field translations update correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment