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

Master web updown arrows edit list svb #31763

Open
wants to merge 2 commits into
base: master
from

Conversation

Projects
None yet
4 participants
@svb-odoo
Copy link

commented Mar 12, 2019

Description of the issue/feature this PR addresses:

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

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

@svb-odoo svb-odoo force-pushed the odoo-dev:master-web-updown-arrows-edit-list-svb branch Mar 12, 2019

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

@svb-odoo

This comment has been minimized.

Copy link
Author

commented Mar 12, 2019

Description of branch:
using up and down arrows in editable list goes to line above and below (this only holds for fields which are not of type text, many2one, many2many and selection). When on last line and arrow down pressed, a new record is created with the required fields

odoo task https://www.odoo.com/web#id=1941142&action=333&active_id=133&model=project.task&view_type=form&menu_id=4720

@C3POdoo C3POdoo added the RD label Mar 12, 2019

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

@svb-odoo svb-odoo force-pushed the odoo-dev:master-web-updown-arrows-edit-list-svb branch Mar 13, 2019

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

@svb-odoo

This comment has been minimized.

Copy link
Author

commented Mar 13, 2019

@vsc-odoo Can you add yourself as reviewer?

@svb-odoo

This comment has been minimized.

Copy link
Author

commented Mar 13, 2019

@VincentSchippefilt can you add yourself as reviewer?

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

@VincentSchippefilt VincentSchippefilt self-requested a review Mar 13, 2019

addons/web/static/src/js/views/list/list_editable_renderer.js Outdated
/**
* Fill the required fields of an empty row with the values of lastRecord
* @param {*} lastRecord
* @returns {Promise}

This comment has been minimized.

Copy link
@VincentSchippefilt

VincentSchippefilt Mar 13, 2019

Contributor

missing param in doc string

addons/web/static/src/js/views/list/list_editable_renderer.js Outdated
fillRequiredNewLine: true,
});
})
if (Number.isInteger(currentFieldIndex)) {

This comment has been minimized.

Copy link
@VincentSchippefilt

VincentSchippefilt Mar 13, 2019

Contributor

this is ES6 and will not work in IE11

addons/web/static/src/js/fields/relational_fields.js Outdated
if (data.fillRequiredWithRecord) {
return self.renderer.fillRequiredFields(data.fillRequiredWithRecord, data.currentFieldIndex);
}
return Promise.resolve();

This comment has been minimized.

Copy link
@VincentSchippefilt

VincentSchippefilt Mar 13, 2019

Contributor

the return seems useless

This comment has been minimized.

Copy link
@svb-odoo

svb-odoo Mar 14, 2019

Author

indeed, thanks for the remark

addons/web/static/src/js/fields/relational_fields.js Outdated
@@ -2041,7 +2045,7 @@ var FieldMany2ManyTags = AbstractField.extend({
* @param {OdooEvent} ev
*/
_onFieldChanged: function (ev) {
if (ev.target !== this.many2one) {
if (ev.target !== this.many2one & ev.data.fillRequiredNewLine === undefined) {

This comment has been minimized.

Copy link
@VincentSchippefilt

VincentSchippefilt Mar 13, 2019

Contributor

you probably want to use && and not &

This comment has been minimized.

Copy link
@svb-odoo

svb-odoo Mar 14, 2019

Author

yes indeed

addons/web/static/src/js/views/list/list_editable_renderer.js Outdated
currentWidget.field.type !== "many2one" &&
currentWidget.field.type !== "many2many" &&
currentWidget.field.type !== "selection" &&
currentWidget.field.type !== "text" //TODO other ones?

This comment has been minimized.

Copy link
@VincentSchippefilt

VincentSchippefilt Mar 13, 2019

Contributor

wow that's ugly... What's the idea here ?

This comment has been minimized.

Copy link
@svb-odoo

svb-odoo Mar 13, 2019

Author

Thanks for the remark, you're right it was not needed because the propagation of the event is stopped in this case. I removed it and it still works

addons/web/static/tests/views/list_tests.js Outdated
//debug: true,
});

// await testUtils.dom.click(list.$('td:contains(-4)')); //int_field=-4 and foo=blip and m2o: 1 (Value 1)

This comment has been minimized.

Copy link
@VincentSchippefilt

VincentSchippefilt Mar 13, 2019

Contributor

don't forget to remove commented out code

This comment has been minimized.

Copy link
@svb-odoo

svb-odoo Mar 13, 2019

Author

yes, thanks, I still have to adapt that one...

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

@svb-odoo svb-odoo force-pushed the odoo-dev:master-web-updown-arrows-edit-list-svb branch Mar 13, 2019

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

@svb-odoo svb-odoo force-pushed the odoo-dev:master-web-updown-arrows-edit-list-svb branch 3 times, most recently to 7b6fac3 Mar 14, 2019

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

@svb-odoo svb-odoo force-pushed the odoo-dev:master-web-updown-arrows-edit-list-svb branch to 5ef1110 Mar 15, 2019

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

@svb-odoo svb-odoo force-pushed the odoo-dev:master-web-updown-arrows-edit-list-svb branch from b9417c5 to 6e2bed6 Mar 15, 2019

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

[IMP] using up and down arrows in editable lists goes to line above a…
…nd below

When on last line and arrow down pressed, a new record is created with the required fields equal to the previous line.

@svb-odoo svb-odoo force-pushed the odoo-dev:master-web-updown-arrows-edit-list-svb branch from 0f7f0fb to 296f537 Mar 22, 2019

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

@svb-odoo svb-odoo force-pushed the odoo-dev:master-web-updown-arrows-edit-list-svb branch 3 times, most recently from 5c46812 to 0471858 Mar 22, 2019

@svb-odoo svb-odoo force-pushed the odoo-dev:master-web-updown-arrows-edit-list-svb branch from 0471858 to 07448fa Mar 26, 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.