Skip to content

Commit d052eef

Browse files
committed
[IMP] project, hr_timesheet: fixes some points after AJU testing
- add domain in fsm - hide fields in project template list view - hide time and partner in project template kanban
1 parent 9f708ee commit d052eef

File tree

4 files changed

+21
-3
lines changed

4 files changed

+21
-3
lines changed

addons/hr_timesheet/views/project_project_views.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@
8686
<t t-set="badgeColor" t-value="'border-danger'" t-if="record.remaining_hours.raw_value &lt; 0"/>
8787
<t t-set="title" t-if="record.encode_uom_in_days.raw_value">Days Remaining</t>
8888
<t t-set="title" t-else="">Time Remaining</t>
89-
<div t-if="record.allow_timesheets.raw_value and record.allocated_hours.raw_value &gt; 0"
89+
<div t-if="!record.is_template.raw_value and record.allow_timesheets.raw_value and record.allocated_hours.raw_value &gt; 0"
9090
t-attf-class="me-1 ms-1 bg-transparent badge border {{ badgeColor }}" t-att-title="title" groups="hr_timesheet.group_hr_timesheet_user">
9191
<field name="remaining_hours" widget="timesheet_uom" class="p-0"/>
9292
</div>
@@ -112,5 +112,16 @@
112112
<record id="project.open_view_project_all_group_stage" model="ir.actions.act_window">
113113
<field name="domain">[('is_internal_project', '=', False), ("is_template", "=", False)]</field>
114114
</record>
115+
116+
<!-- Project Template -->
117+
<record id="project_templates_view_list_inherit_timesheet" model="ir.ui.view">
118+
<field name="name">project.project.template.list.inherit.timesheet</field>
119+
<field name="model">project.project</field>
120+
<field name="inherit_id" ref="project.project_templates_view_list"/>
121+
<field name="arch" type="xml">
122+
<field name="effective_hours" position="replace"/>
123+
<field name="remaining_hours" position="replace"/>
124+
</field>
125+
</record>
115126
</data>
116127
</odoo>

addons/project/models/project_project.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,7 @@ def _get_create_template_from_project_config(self):
12211221

12221222
def action_create_template_from_project(self):
12231223
self.ensure_one()
1224-
template = self.copy(default={"is_template": True})
1224+
template = self.copy(default={"is_template": True, "partner_id": False})
12251225
template._toggle_template_mode(True)
12261226
template.message_post(body=self.env._("Template created from %s.", self.name))
12271227
config = self._get_create_template_from_project_config()

addons/project/static/src/views/components/project_template_dropdown.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,14 @@ export class ProjectTemplateDropdown extends Component {
3737
return ["id", "name"];
3838
}
3939

40+
get projectTemplatesDomain() {
41+
return [["is_template", "=", true]];
42+
}
43+
4044
async onWillStart() {
4145
this.projectTemplates = await this.orm.searchRead(
4246
"project.project",
43-
[["is_template", "=", true]],
47+
this.projectTemplatesDomain,
4448
this.readFields
4549
);
4650
}

addons/project/views/project_project_views.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -713,6 +713,9 @@
713713
<attribute name="column_invisible">False</attribute>
714714
<attribute name="widget">handle</attribute>
715715
</field>
716+
<field name="partner_id" position="replace"/>
717+
<field name="next_milestone_id" position="replace"/>
718+
<field name="milestone_progress" position="replace"/>
716719
</field>
717720
</record>
718721

0 commit comments

Comments
 (0)