Tryton - Issues



Title Attachment Delete and Undelete
Priority bug Status resolved
Superseder Nosy List ced, mike_arbib, pokoli, reviewbot, roundup-bot
Type behavior Components sao, tryton
Assigned To ced Keywords review
Reviews 32121002,30131002
View: 32121002, 30131002

Created on 2017-03-08.17:23:12 by mike_arbib, last changed by roundup-bot.

File name Uploaded Type Edit Remove
attach_1.png mike_arbib, 2017-03-08.17:23:12 image/png
attach_2.png mike_arbib, 2017-03-08.17:23:33 image/png
attach_3.png mike_arbib, 2017-03-08.17:23:40 image/png
attach_4.png mike_arbib, 2017-03-08.17:23:45 image/png
attach_5.png mike_arbib, 2017-03-08.17:23:52 image/png
New changeset a824e9411bd3 by C?dric Krier in branch 'default':
Do not really remove records that do not have parent
New changeset 6915d4b25be7 by C?dric Krier in branch 'default':
Do not really remove records that do not have parent
msg33110 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-04-05.11:31:28
I can confirm that the issue is solved on the latest patch set. Thanks!
review32121002 updated at
review30131002 updated at
msg33106 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-04-05.10:37:30
Indeed it still fails when there is only one attachment and it is removed.
I also changed to use Screen.save_current which is better because it is supposed to be the public API (which made me find some other minor issue).
msg33105 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-04-05.09:26:00
I can still reproduce the issue with last patch set.
review30131002 updated at
review32121002 updated at
msg33102 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-04-04.18:53:09
Last patch set should solve the issue.
msg32672 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-03-22.12:13:14
Here are my steps to reproduce: 

1. Go to Parties -> Parties menu
2. From the list view open the attachments of the first record
3. Add a new attachment and save with the OK button
4. Reopen the attachments and select the delete button to remove the attachment. The record is marked as to delete.
5. When I click the OK button to save the deletion the error permision error is shown

Indeed I can only reproduce it on tryton but not on sao.
msg32635 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-03-21.20:49:04
I can not reproduce such traceback on tryton neither on sao.
msg32443 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-03-13.12:50:20
> I do not understand msg32441. Why is it on this issue?

Because I only get it with the applied patch
msg32442 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-03-13.12:48:52
I do not understand msg32441. Why is it on this issue?
msg32441 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-03-13.12:34:44
I got the following traceback after deleting an existing attachment on tryton:

13110 139633896908544 [2017-03-13 11:30:29,403] DEBUG trytond.protocols.dispatcher <class ''>.read(*([4], [u'resource', u'name', u'type', u'summary', u'last_modification', u'last_user', u'data', u'resource.rec_name', u'rec_name', u'_timestamp'], {u'language': u'es', u'locale': {u'date': u'%d/%m/%Y', u'thousands_sep': u'.', u'decimal_point': u',', u'grouping': [3, 3, 0]}, u'language_direction': u'ltr', '_check_access': True, u'company.rec_name': u'Demo Company, S.L', u'groups': [9, 10, 15, 14, 18, 8, 7, 1, 19, 23, 24, 5, 16, 33, 32, 6, 2, 17, 4, 30, 21, 22, 3, 26, 25, 29, 27, 28, 31, 12, 11, 13, 20], u'employee': None, u'company': 1, u'': u'size'}), **{}) from admin@
Traceback (most recent call last):
  File "/home/sergi/projectes/develop/trytond/trytond/protocols/", line 162, in _dispatch
    result = rpc.result(meth(*c_args, **c_kwargs))
  File "/home/sergi/projectes/develop/trytond/trytond/ir/", line 76, in read
    cls.check_access(ids, mode='read')
  File "/home/sergi/projectes/develop/trytond/trytond/ir/", line 69, in check_access
    if record.resource:
  File "/home/sergi/projectes/develop/trytond/trytond/model/fields/", line 267, in __get__
    return inst.__getattr__(
  File "/home/sergi/projectes/develop/trytond/trytond/model/", line 1367, in __getattr__
    read_data =, ffields.keys())
  File "/home/sergi/projectes/develop/trytond/trytond/ir/", line 77, in read
    return super(ResourceMixin, cls).read(ids, fields_names=fields_names)
  File "/home/sergi/projectes/develop/trytond/trytond/model/", line 726, in read
    cls.raise_user_error('read_error', cls.__name__)
  File "/home/sergi/projectes/develop/trytond/trytond/", line 74, in raise_user_error
    raise UserError(error)
UserError: ('UserError', (u'Est\xe1 intentando leer registros que ya no existen.\n(Tipo de documento: ir.attachment)', ''))
13110 139633896908544 [2017-03-13 11:30:29,406] INFO werkzeug - - [13/Mar/2017 11:30:29] "POST /demo/ HTTP/1.1" 200 -

This is raised on the server after clicking the OK button with a record marked as to remove.

I'm using latest trunk client.
msg32390 (view) Author: [hidden] (mike_arbib) Date: 2017-03-09.13:59:36
I understand.
Despite this, I had to fix it so I looked for the solution and found it here :

Thank you
msg32379 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-03-09.11:20:13
No, we have a strict rules about backport and this behaviour improvement are not part of.
msg32378 (view) Author: [hidden] (mike_arbib) Date: 2017-03-09.10:54:21
I currently work on a 3.8 client, I think it's why it only works partially.
I also applied the patch on 4.0 client and it works fine, as on 4.2.

Do you think it's possible to fix the 3.8 client ? Thanks
msg32374 (view) Author: [hidden] (mike_arbib) Date: 2017-03-09.09:19:40
My mistake, it effectively works fine on 4.2
msg32369 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-03-08.19:55:09
On 2017-03-08 18:49, Michael Arbib wrote:
> The undelete button doesn't reset the line to its initial state but it's only a visual issue. When clicking it and validate, the attachment is well restored.

I can not reproduce, it works as expected here.
msg32368 (view) Author: [hidden] (mike_arbib) Date: 2017-03-08.18:49:56
Thanks for the patch.

I applied it and the delete button grey tints the line instead of delete it directly.

The undelete button doesn't reset the line to its initial state but it's only a visual issue. When clicking it and validate, the attachment is well restored.
review30131002 updated at
review32121002 updated at
msg32365 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-03-08.17:56:41
This happens since r 6dfb2a0a7211 because Group.remove actually remove the record if there is no parent. But I think this test should not exist because we have the force_remove flag. Indeed this removal should only happen on main record and the delete button set the force_remove.
msg32364 (view) Author: [hidden] (mike_arbib) Date: 2017-03-08.17:23:12

When deleting an attachment via the client, I can't undelete it by clicking the "Undelete selected record" because the attachment line is immediately removed.

I tried on another view (Party) with the party adresses : it works fine, i can delete a record then its line is grey tinted.

I would have expected the same behavior.
Date User Action Args
2017-04-12 15:42:00roundup-botsetmessages: + msg33216
2017-04-12 15:41:14roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg33215
2017-04-05 11:31:28pokolisetmessages: + msg33110
2017-04-05 10:37:40reviewbotsetmessages: + msg33108
2017-04-05 10:37:36reviewbotsetmessages: + msg33107
2017-04-05 10:37:31cedsetmessages: + msg33106
2017-04-05 09:26:00pokolisetmessages: + msg33105
2017-04-04 19:10:49reviewbotsetmessages: + msg33104
2017-04-04 19:10:32reviewbotsetmessages: + msg33103
2017-04-04 18:53:10cedsetmessages: + msg33102

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