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

[8.0][FIX] Issue category for tasks #59

Closed
wants to merge 2 commits into from
Closed

[8.0][FIX] Issue category for tasks #59

wants to merge 2 commits into from

Conversation

franksongfeng
Copy link

Inherit _prepare_project_task of the model 'br.generate.projects' and add updating task's 'categ_ids' when creating it.

@oca-clabot
Copy link

Hey @franksongfeng, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: http://odoo-community.org/page/website.cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

* Alex Duan<alex.duan@elico-corp.com>
* Xie XiaoPeng<xie.xiaopeng@elico-corp.com>
* Victor M. Martin <victor.martin@elico-corp.com>

Copy link
Collaborator

Choose a reason for hiding this comment

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

@franksongfeng include yourself as a contributor

@victormmtorres
Copy link
Collaborator

@franksongfeng Please have a check on the comments.

Travis is not working, could you fix it?

@elicoidal
Copy link
Contributor

elicoidal commented Feb 24, 2017

CLA fixed (eCLA Elico)

@elicoidal elicoidal changed the title Fix the issue category for tasks. [8.0][FIX] Issue category for tasks Feb 25, 2017
@elicoidal elicoidal added this to the 8.0 milestone Feb 25, 2017
@elicoidal
Copy link
Contributor

@franksongfeng Please have a check on the comments.
Travis is not working, could you fix it?

Any news?

@victormmtorres
Copy link
Collaborator

@elicoidal Here @franksongfeng there is not too much he could do. First depends on #42 be fixed. Later need to rebase this one and see if any issue.

Here is a Trace:

2016-11-15 07:46:21,087 5319 INFO openerp_test openerp.addons.business_requirement_deliverable_project.tests.test_br: test_br_wizard_apply (openerp.addons.business_requirement_deliverable_project.tests.test_br.BusinessRequirementTestCase)
2016-11-15 07:46:21,934 5319 ERROR openerp_test openerp.sql_db: Programming error: EXCEPT types boolean and integer cannot be matched

cc @sudhir-serpentcs

@victormmtorres
Copy link
Collaborator

@elicoidal This travis depends on merge #42 and later rebase. Then hopefully Travis will be green.

@sudhir-serpentcs please could you do rebase and commit also with UT for _prepare_project_task?

@sudhir-serpentcs
Copy link
Contributor

@victormartinelicocorp #42 travis is already green. Once it is merged, the owner of the PR can rebase this PR.

@elicoidal
Copy link
Contributor

@sudhir-serpentcs my current problem with #42 is that it might imply a change in the current workflow name.

I am in favor of it but it implies to manage properly the migration which is not yet covered by the module.

Still your point is valid :)

@oca-clabot
Copy link

Hey @franksongfeng,
We acknowledge that the following users have signed our Contributor License Agreement:

Appreciation of efforts,
OCA CLAbot

@elicoidal
Copy link
Contributor

@sudhir-serpentcs
Any news? We need to move forward

@sudhir-serpentcs
Copy link
Contributor

@elicoidal Will update you soon on same.

@victormmtorres
Copy link
Collaborator

@elicoidal Will update you soon on same.

@sudhir-serpentcs Any news?

@sudhir-serpentcs
Copy link
Contributor

@victormartinelicocorp @elicoidal #42 is merged. Let me know if I need to do anything for this PR.
I guess owner of the PR should rebase the PR.

@victormmtorres
Copy link
Collaborator

@victormartinelicocorp @elicoidal #42 is merged. Let me know if I need to do anything for this PR.
I guess owner of the PR should rebase the PR.

@sudhir-serpentcs Good news indeed is the way

@franksongfeng Please rebase this PR

cc @elicoidal

Inherit _prepare_project_task of the model 'br.generate.projects' and add updating task's 'categ_ids' when creating it.
@victormmtorres
Copy link
Collaborator

@moylop260 @gurneyalex @dreispt Could give a hand?

Here @franksongfeng has rebased this PR but as Travis test shows still fail on when run test over dependency module:

2017-03-29 05:33:21,511 5392 INFO openerp_test openerp.addons.business_requirement_deliverable_project.tests.test_br: test_br_wizard_apply (openerp.addons.business_requirement_deliverable_project.tests.test_br.BusinessRequirementTestCase)
2017-03-29 05:33:22,282 5392 ERROR openerp_test openerp.sql_db: Programming error: EXCEPT types boolean and integer cannot be matched
LINE 2: ...st(ARRAY[false])) EXCEPT (SELECT project_task_id, project_ca...
^
, in query INSERT INTO project_category_project_task_rel (project_task_id, project_category_id)
(SELECT %s, unnest(%s)) EXCEPT (SELECT project_task_id, project_category_id FROM project_category_project_task_rel WHERE project_task_id=%s)

On the latest merge regards this module was #42
all test passed so not sure it whether the rebase is not ok or whether still remains some bug.

cc @elicoidal @sudhir-serpentcs

def _prepare_project_task(self, line, project_id):
vals = super(BrGenerateProjectsWithCategories, self) \
._prepare_project_task(line, project_id)
vals.update({'categ_ids': [(6, 0, [line.task_categ_id.id])]})

Choose a reason for hiding this comment

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

Maybe your error is about not validated Null case value in the list

You could use new api feature: vals.update({'categ_ids': line.task_categ_id.ids})

Copy link

@moylop260 moylop260 Mar 29, 2017

Choose a reason for hiding this comment

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

IMHO we don't need a module just to update a dict values
Maybe you could use a parameter plus a if from original module instead. It in order to avoid many many modules with small small features.

Copy link
Contributor

Choose a reason for hiding this comment

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

@moylop260 the Categories are in this module and necessary for anybody (so insulated here)

Copy link
Collaborator

Choose a reason for hiding this comment

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

@moylop260 Sounds that only we are updating a dict but what we pursue is modularity and low impact dependency.

By the way @elicoidal as soon is merged OCA/project#239 I would propose a new module
business_requirement_delivarable_main_categ
and
business_requirement_delivarable_project_main_categ

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe your error is about not validated Null case value in the list
You could use new api feature: vals.update({'categ_ids': line.task_categ_id.ids})

@moylop260 Thanks we'll try

@victormmtorres
Copy link
Collaborator

@franksongfeng Could you try to fix

You could use new api feature: vals.update({'categ_ids': line.task_categ_id.ids})

cc @elicoidal

@elicoidal
Copy link
Contributor

@victormartinelicocorp Maybe you can do it.

@victormmtorres
Copy link
Collaborator

I'll do

@elicoidal
Copy link
Contributor

@victormartinelicocorp any news on this PR?

@elicoidal
Copy link
Contributor

Superseded by #109

@elicoidal elicoidal closed this Apr 9, 2017
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.

6 participants