Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • Tryton Tryton
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 714
    • Issues 714
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 71
    • Merge requests 71
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar

April 05-07 - Mercurial Paris Conference 2023 - One day of workshop dedicated to Heptapod and Mercurial usage and workflow. There are still places available for both workshops and talks!

  • TrytonTryton
  • TrytonTryton
  • Issues
  • #11960
Closed
Open
Issue created Dec 22, 2022 by Nicolas Évrard@nicoe👾Owner

On 6.0, using in a form a O2M in tree mode results in a

You have to follow the following scenario

  1. Open the form on a record it should display the O2M in tree mode
  2. Go to the next record
  3. Go back to the list view of records
  4. Do a search

It will result in the following traceback:

File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/view/screen_container.py", line 527, in activate
    self.do_search(widget)
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/view/screen_container.py", line 530, in do_search
    self.screen.search_filter(self.get_text())
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/screen/screen.py", line 317, in search_filter
    self.clear()
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/screen/screen.py", line 1150, in clear
    self.group.clear()
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/model/group.py", line 138, in clear
    record.destroy()
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/model/record.py", line 670, in destroy
    v.destroy()
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/model/group.py", line 521, in destroy
    self.clear()
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/model/group.py", line 138, in clear
    record.destroy()
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/model/record.py", line 670, in destroy
    v.destroy()
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/model/group.py", line 521, in destroy
    self.clear()
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/model/group.py", line 139, in clear
    self.signal(
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/signal_event.py", line 15, in signal
    fnct(self, signal_data, *data)
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/screen/screen.py", line 444, in _group_list_changed
    view.group_list_changed(group, signal)
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/view/list.py", line 915, in group_list_changed
    self.display()
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/view/list.py", line 1033, in display
    self.record = current_record
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/view/__init__.py", line 49, in record
    self.screen.current_record = value
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/screen/screen.py", line 470, in __set_current_record
    self.signal('record-message', (pos, len(self.group) + self.offset,
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/signal_event.py", line 15, in signal
    fnct(self, signal_data, *data)
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 501, in _sig_label
    self._set_button_sensitive()
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 276, in _set_button_sensitive
    deletable = self.screen.deletable
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/screen/screen.py", line 157, in deletable
    return all(r.deletable for r in self.selected_records)
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/screen/screen.py", line 1127, in selected_records
    return self.current_view.selected_records if self.current_view else []
  File "/home/nicoe/projets/tryton/old-repos/tryton-env/6.0/tryton/tryton/gui/window/view_form/view/list.py", line 1168, in selected_records
    sel.selected_foreach(_func_sel_get, records)

AttributeError: 'NoneType' object has no attribute 'selected_foreach'

My interpretation was that there was a signal that was not correctly disconnected. Unfortunately, the signal between the Screen and the Group cannot be removed as it's used to update the screen when new records are added to the group.

I finally opted for a check on get_realized() in https://foss.heptapod.net/tryton/tryton/-/blob/2513bd1a6b39ae78f27de2f58910ec223b022ea1/tryton/tryton/gui/window/view_form/view/list.py#L1167 but I may have missed a way to disconnect the signal at the right time.

Version 6.4 and onwards are not impacted because the signals have been removed.

Edited Jan 02, 2023 by Nicolas Évrard
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking