Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hbrunn
Copy link
Member

@hbrunn hbrunn commented Dec 21, 2016

x2many defaults

This module was written to allow you to use the previous line's input as defaults for the next line you add.

Usage

  • on a x2many field, say options="{'web_x2m_defaults_from_previous': ['field1', 'field2']}"
  • after the first line of input, succeeding lines will have the last input's values as default
  • demo data adds this for the ACL list field in the groups form

Known issues / Roadmap

  • many2many fields are not yet supported

@hbrunn hbrunn added this to the 8.0 milestone Dec 21, 2016
Copy link
Contributor

@jjscarafia jjscarafia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice feature! Tested on runbot. Clean code

Copy link

@moylop260 moylop260 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

Copy link
Contributor

@lasley lasley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat, thanks @hbrunn

Are the booleans supposed to default as well? In the case of the demo, the access fields.

@hbrunn
Copy link
Member Author

hbrunn commented Dec 28, 2016

No, only name and model_id: https://github.com/OCA/web/pull/510/files#diff-233b2dfda416b2628574af7a0a43b7e4R9 - but if you patch one of the booleans into the view, this will work too.

Copy link
Contributor

@lasley lasley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet thanks @hbrunn

@lasley lasley merged commit a27c39a into OCA:8.0 Dec 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants