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

web kanban sequence drag drop vas #28581

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
5 participants

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Nov 12, 2018

@C3POdoo C3POdoo added the RD label Nov 13, 2018

@vas-odoo vas-odoo force-pushed the odoo-dev:master-web-kanban-sequence-drag_drop-vas branch Dec 4, 2018

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Dec 4, 2018

@robodoo robodoo removed the CI 🤖 label Dec 19, 2018

@mart-e mart-e force-pushed the odoo-dev:master-web-kanban-sequence-drag_drop-vas branch Feb 4, 2019

@aab-odoo
Copy link
Contributor

aab-odoo left a comment

The current solution is quite good. However, i have two requests:

  • it should work for x2many kanban views in form views
  • the resequence problem is tricky, and it is already handled in list view. All usecases (list, kanban, x2many kanban) should use the same code.

For now, some logic that should be done in the controller is done in editable_list_renderer (see _resequence). Renderers (kanban and list) should simply trigger up an event (e.g. resequence_records) with the local_id of the parent datapoint (of type list), the local_id of the moved record, and the index where it has been dropped. Then the controller (BasicController), should intercept this event and handle it correctly (by implementing most of the logic that is currently in editable_list_renderer.js).

Could you try to do that? Don't hesitate if you have any question or remark. Thanks!

addons/web/static/src/js/views/kanban/kanban_renderer.js Outdated
@@ -111,6 +111,10 @@ var KanbanRenderer = BasicRenderer.extend({
var templates = findInNode(this.arch, function (n) { return n.tag === 'templates';});
transformQwebTemplate(templates, state.fields);
this.qweb.add_template(utils.json_node_to_xml(templates));
var handleField = _.find(this.arch.children, function(c) {

This comment has been minimized.

@aab-odoo

aab-odoo Feb 6, 2019

Contributor

i'd only activate the d&g feature if widget="handle" is specified

        var handleField = _.findWhere(this.state.fieldsInfo.kanban, {widget: 'handle'});
        this.handleField = handleField && handleField.name;

This comment has been minimized.

@msh-odoo

msh-odoo Feb 7, 2019

Author Contributor

@aab-odoo The reason why I support sequence field because if you group kanban and do drag and drop record in same column then it calls resequence which do resequence on sequence field by default, so to have same behaviour like if handle field is not defined then it will do resequence on sequence field I kept this.

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Feb 8, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Feb 19, 2019

@msh-odoo msh-odoo force-pushed the odoo-dev:master-web-kanban-sequence-drag_drop-vas branch Feb 22, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Feb 22, 2019

@msh-odoo msh-odoo force-pushed the odoo-dev:master-web-kanban-sequence-drag_drop-vas branch Mar 1, 2019

@robodoo robodoo removed the CI 🤖 label Mar 1, 2019

@msh-odoo msh-odoo force-pushed the odoo-dev:master-web-kanban-sequence-drag_drop-vas branch Mar 1, 2019

@robodoo robodoo added the CI 🤖 label Mar 1, 2019

@msh-odoo msh-odoo force-pushed the odoo-dev:master-web-kanban-sequence-drag_drop-vas branch to 3f47075 Mar 14, 2019

@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Mar 14, 2019

@msh-odoo

This comment has been minimized.

Copy link
Contributor Author

msh-odoo commented Mar 15, 2019

LGTM

@aab-odoo aab-odoo force-pushed the odoo-dev:master-web-kanban-sequence-drag_drop-vas branch from 1b4589b to 96e20a7 Mar 21, 2019

@robodoo robodoo removed the CI 🤖 label Mar 21, 2019

@aab-odoo aab-odoo force-pushed the odoo-dev:master-web-kanban-sequence-drag_drop-vas branch from 96e20a7 to 6fcc788 Mar 21, 2019

[IMP] web: enable drag&drop in ungrouped kanban views
With this rev., the resequencing feature (with drag and drop) that
was already available in list views is now available also in kanban
views having a field with widget="handle". This works for main as
well as x2many kanban views.

Some code handling the resequencing has been moved from the list
components (controller and renderer) to the basic ones, so that the
logic is shared between list and kanban.

Task 1902808

Co-authored-by: Mohammed Shekha <msh@openerp.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>

@aab-odoo aab-odoo force-pushed the odoo-dev:master-web-kanban-sequence-drag_drop-vas branch from 6fcc788 to 69c5128 Mar 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.