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

[10.0] Add default related action to open related records #79

Merged
merged 1 commit into from
Jun 28, 2018

Conversation

guewen
Copy link
Member

@guewen guewen commented Jun 21, 2018

Backport from #46

The related action button now opens by default the record on which the
job is working. It uses the default views of the job. The exact behavior
depends of the number of records in the job:

  • No record (job called on a model): display a message indicating that
    there is no available action
  • One record: open the default view in form
  • Several records: open the default view in list

The related action can still be overridden by the 'related_action'
decorator.

@guewen guewen force-pushed the 10.0-backport-default-related-action branch from 8475cc7 to 925a8b0 Compare June 21, 2018 06:41
@guewen guewen changed the title Add default related action to open related records [10.0] Add default related action to open related records Jun 21, 2018
@lmignon
Copy link
Contributor

lmignon commented Jun 21, 2018

@guewen Travis is not happy with the backport...

@guewen guewen force-pushed the 10.0-backport-default-related-action branch from 925a8b0 to 820b93b Compare June 21, 2018 07:11
@guewen
Copy link
Member Author

guewen commented Jun 21, 2018

Python3 idiom :/

TypeError: super() takes at least 1 argument (0 given)
2018-06-21 06:50:08,616 4349 ERROR openerp_test odoo.addons.test_queue_job.tests.test_related_actions: `   File "/home/travis/build/OCA/queue/test_queue_job/tests/test_related_actions.py", line 15, in setUpClass
2018-06-21 06:50:08,616 4349 ERROR openerp_test odoo.addons.test_queue_job.tests.test_related_actions: `     super().setUpClass()
2018-06-21 06:50:08,616 4349 ERROR openerp_test odoo.addons.test_queue_job.tests.test_related_actions: ` TypeError: super() takes at least 1 argument (0 given)

@guewen
Copy link
Member Author

guewen commented Jun 21, 2018

Well I'll run the test locally and stop leveraging travis for that :-/ (tested from the UI it works though)

The related action button now opens by default the record on which the
job is working. It uses the default views of the job. The exact behavior
depends of the number of records in the job:

* No record (job called on a  model): display a message indicating that
there is no available action
* One record: open the default view in form
* Several records: open the default view in list

The related action can still be overridden by the 'related_action'
decorator.
@guewen guewen force-pushed the 10.0-backport-default-related-action branch from 820b93b to ba4feaa Compare June 21, 2018 07:33
@coveralls
Copy link

coveralls commented Jun 21, 2018

Coverage Status

Coverage increased (+0.3%) to 77.939% when pulling ba4feaa on guewen:10.0-backport-default-related-action into 260b939 on OCA:10.0.

@guewen
Copy link
Member Author

guewen commented Jun 21, 2018

Fixed :)

Copy link
Contributor

@lmignon lmignon 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 @guewen

Copy link

@leemannd leemannd left a comment

Choose a reason for hiding this comment

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

Thanks. Code review only

@guewen guewen merged commit 9948f01 into OCA:10.0 Jun 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants