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

[16.0][mig] project_deadline: Migration to 16.0 #1351

Open
wants to merge 20 commits into
base: 16.0
Choose a base branch
from

Conversation

anusriNPS
Copy link

@anusriNPS anusriNPS commented Oct 16, 2024

Migrating project_deadline to 16.0

Reopened PR: #1123

@anusriNPS anusriNPS changed the title 16.0 mig project deadline [16.0][mig] project_deadline: Migration to 16.0 Oct 16, 2024
@anusriNPS
Copy link
Author

@heliaktiv , I have reopened PR of migrating project_deadline to 16.0 and I would request you to review it

Copy link

@PicchiSeba PicchiSeba left a comment

Choose a reason for hiding this comment

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

Code review: LGTM

@aleuffre
Copy link

Comment on lines 17 to 18
self.assertIn("date_start", res["arch"])
self.assertIn("date", res["arch"])

Choose a reason for hiding this comment

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

question: why were these two lines changed to be the opposite of what they were before?

Copy link
Author

Choose a reason for hiding this comment

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

As part of Odoo 16.0 addons project view, date_start and date fields are included in the xml whose external id is "edit_project" which is displayed as "Planned Date".

https://github.com/odoo/odoo/blob/16.0/addons/project/views/project_views.xml#L506C28-L511C119

Screenshot from 2024-10-22 16-45-36

As this is available as part of Odoo addons project module, I am removing project_project related code changes which appends date_start and date field to the form view from project_deadline module.
Also, the testcase related to it is also no longer valid for 16.0 version

@anusriNPS
Copy link
Author

I tried to squash the commit, but it resulted in merge conflict issue related to project_hr commits, so could not do it.

When git rebase -i origin/16.0 is executed, it lists other project related repos like project_hr and showing merge conflicts related to hr project during squash

image

Is there any way to get only project_deadline related commits alone, so that it can be squashed?

@aleuffre
Copy link

I tried to squash the commit, but it resulted in merge conflict issue related to project_hr commits, so could not do it.

When git rebase -i origin/16.0 is executed, it lists other project related repos like project_hr and showing merge conflicts related to hr project during squash

image

Is there any way to get only project_deadline related commits alone, so that it can be squashed?

I suspect your repo may be outdated. Can you try git fetch origin 16.0 and then try to rebase again?

oca-travis and others added 12 commits October 21, 2024 16:46
Currently translated at 80.0% (4 of 5 strings)

Translation: project-14.0/project-14.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_deadline/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: project-14.0/project-14.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_deadline/
Currently translated at 100.0% (8 of 8 strings)

Translation: project-14.0/project-14.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_deadline/es_AR/
Currently translated at 100.0% (8 of 8 strings)

Translation: project-14.0/project-14.0-project_deadline
Translate-URL: https://translation.odoo-community.org/projects/project-14-0/project-14-0-project_deadline/it/
@anusriNPS anusriNPS force-pushed the 16.0-mig-project_deadline branch 2 times, most recently from b66b060 to a635b8a Compare October 22, 2024 15:31
Copy link

@aleuffre aleuffre left a comment

Choose a reason for hiding this comment

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

Code review, mostly looks good to me, only a couple of suggestions.

I also think the changes to the translation files should be removed from the migration commit.

Comment on lines 10 to 17
<xpath expr="//span[@t-if='record.partner_id.value']" position="after">
<t
t-if="record.date.raw_value and record.date.raw_value lt (new Date())"
t-if="record.date.raw_value and record.date.raw_value lt (new Date().toISOString())"
t-set="red"
>oe_kanban_text_red</t>
Copy link

Choose a reason for hiding this comment

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

suggestion (non-blocking): Instead of comparing two strings, we could turn record.date.raw_value into a Date object. See here for an example:

https://github.com/OCA/social/blob/16.0/mail_activity_board/views/mail_activity_view.xml#L186-L190

Copy link
Author

Choose a reason for hiding this comment

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

resolved

Comment on lines 15 to 28
<t t-if="record.partner_id.value">
<span style="margin-left: 10px;" t-attf-class="#{red || ''}">
<i>
<field name="date" />
</i>
</span>
</t>
<t t-else="">
<span t-attf-class="#{red || ''}">
<i>
<field name="date" />
</i>
</span>
</t>
Copy link

Choose a reason for hiding this comment

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

issue(non-blocking): This could be done more elegantly without the t-if and t-else, maybe with a t-att-style?

Copy link
Author

Choose a reason for hiding this comment

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

Resolved

Copy link

@aleuffre aleuffre left a comment

Choose a reason for hiding this comment

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

Code review, ok.

However, upon functional review, I wonder if this module is worth migrating at all. Since we don't need to add the core fields that this module would offer, all we're adding is two related fields on project.task.

At the very least, the readme should be updated to reflect the much more limited scope of this module, but maybe the module can be dropped entirely.

Comment on lines 4 to 32
<odoo>
<record id="view_project_kanban" model="ir.ui.view">
<field name="name">view_project_kanban</field>
<field name="model">project.project</field>
<field name="inherit_id" ref="project.view_project_kanban" />
<field name="arch" type="xml">
<xpath expr="//span[@t-if='record.partner_id.value']" position="after">
<t
t-if="record.date.raw_value and ((new Date(record.date.raw_value)) lt (new Date()))"
t-set="red"
>oe_kanban_text_red</t>
<span
style="margin-left: 10px;"
t-attf-class="{{ record.partner_id.value ? red : ''}}"
>
<i>
<field name="date" />
</i>
</span>
</xpath>
</field>
</record>
</odoo>
Copy link

Choose a reason for hiding this comment

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

issue: Tested on runboat. We already have this info in the kanban.

image

(The date above is added by this module, the two dates below are in the base module)

Looking at the code, even the styling is the same. So we don't need this view at all.

Copy link
Author

Choose a reason for hiding this comment

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

Though I saw this information on the kanban view , since in 14.0 date was shown seperately near Partner_id I thought it should be shown in 16.0 even we have start and end date, hence added this.

Removed some of the code as those were not necessary in 16.0 however I misinterpreted this date information behaviour and added here

image

Copy link
Author

Choose a reason for hiding this comment

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

When project deadline is exceeded, in the base view date color is not changed to "Red" which is different from 14.0 view.

Suggestion: Instead of including new field which shows exceeded date in "Red", date already available can be shown in "Red" color.

image

Copy link
Author

Choose a reason for hiding this comment

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

Latest patchset:

image

When partner id is assigned, deadline surpassed will be indicated in "Red"

@anusriNPS anusriNPS force-pushed the 16.0-mig-project_deadline branch 2 times, most recently from e38671f to af04c35 Compare November 8, 2024 10:25
Copy link

@aleuffre aleuffre left a comment

Choose a reason for hiding this comment

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

Code review, LGTM.

My doubts about whether this module is really useful remain, but I'll leave it up to a maintainer to decide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.