Tryton - Issues

 

Issue6220

Title readonly one2many editable with keyboard
Priority bug Status resolved
Superseder Nosy List ced, jcavallo, m.aboutayeb, pokoli, reviewbot, roundup-bot
Type behavior Components sao, tryton
Assigned To ced Keywords review
Reviews 33071002,26091002
View: 33071002, 26091002

Created on 2017-01-27.16:51:00 by m.aboutayeb, last changed by roundup-bot.

Files
File name Uploaded Type Edit Remove
test_6220.tar.gz jcavallo, 2017-01-27.18:14:28 application/gzip
Messages
New changeset aa47a4468305 by C?dric Krier in branch 'default':
Disable create new record from key on read-only editable tree
http://hg.tryton.org/sao/rev/aa47a4468305
New changeset 5644c95055aa by C?dric Krier in branch 'default':
Disable create new record from key on read-only editable tree
http://hg.tryton.org/tryton/rev/5644c95055aa
msg31824 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-02-08.21:27:24
The saving of readonly one2many will be managed in issue6256.
This issue will stay focus on the edition of readonly one2many.
msg31809 (view) Author: [hidden] (m.aboutayeb) Date: 2017-02-08.14:52:08
I did not test sao (I do not use it). I only tested tryton client.

For static readonly:
"down" keyboard shortcut doesn't create a new line, which is good. However, when changing an existing record's values, changes are discarded when saving.
msg31807 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-02-08.14:40:06
On 2017-02-08 14:20, MAboutayeb wrote:
> I tested with the last patch it works with readonly in states dictionnary.

Did you test both clients?
Did you test with static readonly?
msg31806 (view) Author: [hidden] (m.aboutayeb) Date: 2017-02-08.14:20:24
I tested with the last patch it works with readonly in states dictionnary.
review26091002 updated at https://codereview.tryton.org/26091002/#ps40001
review33071002 updated at https://codereview.tryton.org/33071002/#ps40001
msg31787 (view) Author: [hidden] (m.aboutayeb) Date: 2017-02-08.11:01:53
Yes I am testing the last patch version only. I was wondering if I have to include changes made in the first patch too?
For the testing scenario, when using readonly in field's state dictionnary:
Use "down" keyboard shortcut. It adds a new line. Write some fields values in the new line. Save. New line disappears. 
Also: change any existing record values in the editable tree. Save. Changes just made are discarded.
msg31785 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-02-08.10:52:59
> it disappears when i save

I can not understand how a record could disappear. Can you describe precisely your testing scenario.

> I am unable to modifiy existing records

Are you sure, you are testing the last patch version?
msg31783 (view) Author: [hidden] (m.aboutayeb) Date: 2017-02-08.10:30:07
I applied the patch, but it's still not working.
First of all, there seems to be a difference between readonly in field's states dictionnary and as a field's option.

When I use readonly in field's states dictionnary:
I am able to add a line with the keyboard shortcut, and it disappears when i save. However, I am unable to modifiy existing records, as all changes are discarded when I save.

When I use readonly in field's options:
I am both able to add new lines with the keyboard shortcut and they are saved, and to change existing records.
review26091002 updated at https://codereview.tryton.org/26091002/#ps20001
review33071002 updated at https://codereview.tryton.org/33071002/#ps20001
review26091002 updated at https://codereview.tryton.org/26091002/#ps1
review33071002 updated at https://codereview.tryton.org/33071002/#ps1
msg31741 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-02-07.01:45:00
Please test review33071002 and review26091002
msg31556 (view) Author: [hidden] (jcavallo) Date: 2017-01-30.10:23:08
@pokoli This would break navigation for editable trees, so that seems a little
extreme. Maybe I'll have a look.
msg31550 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-01-30.09:33:19
@jcavallo that was the clue. I can reporduce it but only using the down arrow. So I think that keyboard shortcuts must be disabled when the widget is readonly.
msg31532 (view) Author: [hidden] (jcavallo) Date: 2017-01-27.18:14:28
@pokoli I can reproduce using the provided test module.

The "Add" button is indeed disabled, but using the "Down"
arrow key will create a new line anyway.
msg31528 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-01-27.17:30:02
I still can not reproduce it. I'm testing with the contact mechanism field of parties which is editable and it's readonly when the party is inactive.

I can not create new contact mechanism on inactive parties but I can when the party is active. And this is the expected behaviour. 

Are you sure this is due to the editable definition of the field?
msg31526 (view) Author: [hidden] (m.aboutayeb) Date: 2017-01-27.17:05:24
I am working on version 4.2.2, gtk client
msg31524 (view) Author: [hidden] (pokoli) (Tryton committer) Date: 2017-01-27.16:57:03
For me this should be a bug. 

I can not reproduce it with latest trunk. Tested with sao and with gtk client. 

Which version are you working on?
msg31523 (view) Author: [hidden] (m.aboutayeb) Date: 2017-01-27.16:51:00
The "readonly" state on One2Many fields should allow editing existing records, and forbid adding new records. However, in a list view of a One2Many field, when the option editable="bottom" is active, the readonly state doesn't change the behavior: it is possible to both add new records and edit existing ones.
History
Date User Action Args
2017-02-17 18:48:03roundup-botsetmessages: + msg32044
2017-02-17 18:47:26roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg32043
2017-02-08 21:27:25cedsetmessages: + msg31824
title: One2Many fields: 'readonly' state -> readonly one2many editable with keyboard
2017-02-08 14:52:08m.aboutayebsetmessages: + msg31809
2017-02-08 14:40:06cedsetmessages: + msg31807
2017-02-08 14:20:25m.aboutayebsetmessages: + msg31806
2017-02-08 11:45:31reviewbotsetmessages: + msg31793
2017-02-08 11:45:13reviewbotsetmessages: + msg31792
2017-02-08 11:01:53m.aboutayebsetmessages: + msg31787
2017-02-08 10:53:00cedsetmessages: + msg31785

Showing 10 items. Show all history (warning: this could be VERY long)