Merge branch 'development' into 'master'

Development

See merge request prakash.jain/cor-odoo!147
This commit is contained in:
prakash.jain 2021-03-08 23:26:39 -08:00
commit 9cca08af47
20 changed files with 554 additions and 32 deletions

View File

@ -14,33 +14,43 @@ import dateutil.parser
class AccountAnalyticLine(models.Model):
_inherit = 'account.analytic.line'
def _domain_project_id(self):
domain = [('allow_timesheets', '=', True),('is_sub_project', '=', False)]
if not self.user_has_groups('hr_timesheet.group_timesheet_manager'):
return expression.AND([domain,
['|', ('privacy_visibility', '!=', 'followers'), ('allowed_internal_user_ids', 'in', self.env.user.ids)]
])
return domain
project_id = fields.Many2one(
'project.project', 'Project', compute='_compute_project_id', store=True, readonly=False,
domain=_domain_project_id)
start_time = fields.Float(string='Start Time', digits=(16, 2))
end_time = fields.Float(string='End Time', digits=(16, 2))
start_datetime = fields.Datetime("Start Time", required=True)
end_datetime = fields.Datetime("End Time", required=True)
unit_amount = fields.Float('Duration', default=0.0)
parent_project = fields.Many2one('project.project', related='project_id.parent_project', string='Parent Project')
sub_project = fields.Many2one('project.project', domain="[('is_sub_project', '=', True)]",
string='Sub Project')
@api.onchange('project_id')
def _onchange_sub_project_id(self):
self.sub_project = False
res = {}
if self.project_id and self.project_id.sub_project:
res['domain'] = {'sub_project': [('id', 'in', self.project_id.sub_project.ids)]}
else:
res['domain'] = {'sub_project': [('id', '=', False)]}
return res
def _default_start_datetime(self):
return fields.Datetime.to_string(datetime.combine(fields.Datetime.now(), datetime.min.time()))
def _default_end_datetime(self):
return fields.Datetime.to_string(datetime.combine(fields.Datetime.now(), datetime.max.time()))
start_datetime = fields.Datetime("Start Time", required=True)
end_datetime = fields.Datetime("End Time", required=True)
# @api.onchange('project_id')
# def _onchange_parent_project_id(self):
# if self.project_id:
# parent_project = self.env['project.project'].search([('sub_project', '=', self.project_id.id)], limit=1)
# if parent_project:
# self.parent_project = parent_project.id
# else:
# self.parent_project = False
# else:
# self.parent_project = False
@api.onchange('employee_id')
def _onchange_employee_id(self):
@ -90,7 +100,7 @@ class AccountAnalyticLine(models.Model):
self.task_id = False
return result
_sql_constraints = [
"""_sql_constraints = [
('check_start_time_lower_than_24', 'CHECK(start_time <= 24)', 'You cannot have a start hour greater than 24'),
('check_start_time_positive', 'CHECK(start_time >= 0)', 'Start hour must be a positive number'),
('check_end_time_lower_than_24', 'CHECK(end_time <= 24)', 'You cannot have a end hour greater than 24'),
@ -110,7 +120,7 @@ class AccountAnalyticLine(models.Model):
res = self.end_time - self.start_time
if res <= 0:
raise ValidationError(_("End time cannot be earlier than Start time"))
self.unit_amount = res
self.unit_amount = res"""
@api.onchange('start_datetime', 'end_datetime')
def _onchange_start_end_date_time(self):
@ -155,7 +165,7 @@ class AccountAnalyticLine(models.Model):
ttask = res['datas'][index][taskindex]
if type(ttask) == bool:
res['datas'][index][taskindex] = ''
if fields_name.get('start_time') is not None:
"""if fields_name.get('start_time') is not None:
starttimeindex = fields_name.get('start_time')
starttime = float(res['datas'][index][starttimeindex])
if starttime:
@ -166,13 +176,15 @@ class AccountAnalyticLine(models.Model):
endtime = float(res['datas'][index][endtimeindex])
if endtime:
end_time = tools.format_duration(endtime)
res['datas'][index][endtimeindex] = end_time
res['datas'][index][endtimeindex] = end_time"""
if fields_name.get('unit_amount') is not None:
durationindex = fields_name.get('unit_amount')
duration = res['datas'][index][durationindex] and float(res['datas'][index][durationindex])
if duration:
duration_time = tools.format_duration(duration)
duration_time = round(duration, 2)
res['datas'][index][durationindex] = duration_time
#duration_time = tools.format_duration(duration)
#res['datas'][index][durationindex] = duration_time
return res
@api.model

View File

@ -77,7 +77,7 @@ class ProjectConsultantHrs(models.Model):
val.budgeted_hours = 0
@api.depends('project_id', 'start_date', 'end_date', 'project_id.timesheet_ids', 'project_id.timesheet_ids.date', 'project_id.timesheet_ids.project_id',
'project_id.timesheet_ids.employee_id', 'project_id.timesheet_ids.start_time', 'project_id.timesheet_ids.end_time', 'project_id.timesheet_ids.unit_amount')
'project_id.timesheet_ids.employee_id', 'project_id.timesheet_ids.start_datetime', 'project_id.timesheet_ids.end_datetime', 'project_id.timesheet_ids.unit_amount')
def _compute_actual_calc(self):
Timesheet = self.env['account.analytic.line']
for val in self:

View File

@ -21,8 +21,6 @@
<field name="inherit_id" ref="hr_timesheet.view_task_form2_inherited"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='timesheet_ids']//tree//field[@name='name']" position="after">
<field name="start_time" widget="float_time" invisible="1"/>
<field name="end_time" widget="float_time" invisible="1"/>
<field name="start_datetime" string="Start date"/>
<field name="end_datetime" string="End date"/>
</xpath>
@ -69,17 +67,16 @@
<field name="employee_id" invisible="1"/>
<field name="project_id" required="1" options="{'no_create_edit': True}"
context="{'form_view_ref': 'project.project_project_view_form_simplified',}"/>
<field name="sub_project" options="{'no_open': True, 'no_create': True, 'no_create_edit': True}"/>
<field name="task_id" optional="show" options="{'no_create_edit': True, 'no_open': True}"
widget="task_with_hours" context="{'default_project_id': project_id}"
domain="[('project_id', '=', project_id)]"/>
<field name="name" optional="show" required="0"/>
<field name="start_time" widget="float_time" invisible="1"/><!--custom-->
<field name="end_time" widget="float_time" invisible="1"/><!--custom-->
<field name="start_datetime" string="Start Time"/><!--custom-->
<field name="end_datetime" string="End Time"/><!--custom-->
<field name="unit_amount" optional="show" widget="timesheet_uom" sum="Total"
decoration-danger="unit_amount &gt; 24"/>
<field name="parent_project" options="{'no_open': True, 'no_create': True, 'no_create_edit': True}"/><!--custom-->
<!--<field name="parent_project" options="{'no_open': True, 'no_create': True, 'no_create_edit': True}"/>--><!--custom-->
<field name="company_id" invisible="1"/>
<field name="user_id" invisible="1"/>
</tree>
@ -163,6 +160,7 @@
<group>
<field name="project_id" required="1"
context="{'form_view_ref': 'project.project_project_view_form_simplified',}"/>
<field name="sub_project" options="{'no_open': True, 'no_create': True, 'no_create_edit': True}"/>
<field name="task_id" widget="task_with_hours" context="{'default_project_id': project_id}"
domain="[('project_id', '=', project_id)]"/>
<field name="company_id" groups="base.group_multi_company"/>
@ -171,8 +169,6 @@
<group>
<!--<field name="amount"/>-->
<field name="amount" invisible="1"/>
<field name="start_time" widget="float_time" invisible="1"/><!--custom-->
<field name="end_time" widget="float_time" invisible="1"/><!--custom-->
<field name="start_datetime" string="Start Time"/><!--custom-->
<field name="end_datetime" string="End Time"/><!--custom-->
<field name="unit_amount" widget="timesheet_uom" decoration-danger="unit_amount &gt; 24"/>
@ -184,6 +180,42 @@
</field>
</record>
<record id="timesheet_view_inherit1_search" model="ir.ui.view">
<field name="name">account.analytic.line.search</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_search"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='date']" position="replace">
<!-- <field name="start_datetime"/> -->
</xpath>
<xpath expr="//filter[@name='month']" position="replace">
<filter name="month" string="Start Time" date="start_datetime"/>
</xpath>
<xpath expr="//filter[@name='groupby_date']" position="replace">
<filter string="Start Time" name="groupby_startdate" domain="[]" context="{'group_by': 'start_datetime'}" help="Timesheet by Start Date"/>
</xpath>
</field>
</record>
<!--<record id="view_account_analytic_line_inherit1_filter" model="ir.ui.view">
<field name="name">account.analytic.line.search2</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="analytic.view_account_analytic_line_filter"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='date']" position="replace">
<field name="start_datetime"/>
</xpath>
<xpath expr="//filter[@name='date']" position="replace">
<filter string="Start Time" name="start_datetime" date="date"/>
</xpath>
<xpath expr="//group[@name='groupby']//filter[@name='group_date']" position="replace">
<filter string="Start Time" name="group_startdate" context="{'group_by': 'start_datetime'}"/>
</xpath>
</field>
</record>-->
>>>>>>> 0964d5378c9e26188e9e977126bb2beb977992ea
<record id="view_hr_my_timesheet_line_calendar" model="ir.ui.view">
<field name="name">account.analytic.line.calendar</field>
<field name="model">account.analytic.line</field>

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="TestRunnerService">
<option name="PROJECT_TEST_RUNNER" value="Unittests" />
</component>
</module>

4
field_hide/.idea/misc.xml Executable file
View File

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.5" project-jdk-type="Python SDK" />
</project>

8
field_hide/.idea/modules.xml Executable file
View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/custom_project.iml" filepath="$PROJECT_DIR$/.idea/custom_project.iml" />
</modules>
</component>
</project>

6
field_hide/.idea/vcs.xml Executable file
View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>

327
field_hide/.idea/workspace.xml Executable file
View File

@ -0,0 +1,327 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="f5969a27-7ce4-4027-ab86-6f490ab732cf" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/../exam_test_quiz/controllers/test.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../Hr_Board/models/employee.py" beforeDir="false" afterPath="$PROJECT_DIR$/../Hr_Board/models/employee.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../Hr_Board/views/employee.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../Hr_Board/views/employee.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/base.sql" beforeDir="false" afterPath="$PROJECT_DIR$/../base/base.sql" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/ar.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/ar.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/bg.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/bg.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/ca.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/ca.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/cs.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/cs.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/de.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/de.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/es.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/es.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/et.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/et.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/eu.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/eu.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/fi.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/fi.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/fr.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/fr.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/gu.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/gu.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/he.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/he.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/it.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/it.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/lt.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/lt.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/nb.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/nb.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/nl.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/nl.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/pl.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/pl.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/pt.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/pt.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/pt_BR.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/pt_BR.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/ro.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/ro.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/sk.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/sk.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/sl.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/sl.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/sv.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/sv.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/tr.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/tr.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/vi.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/vi.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/zh_CN.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/zh_CN.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/i18n/zh_TW.po" beforeDir="false" afterPath="$PROJECT_DIR$/../base/i18n/zh_TW.po" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/ir/ir_actions.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/ir/ir_actions.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/ir/ir_attachment.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/ir/ir_attachment.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/ir/ir_http.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/ir/ir_http.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/ir/ir_model.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/ir/ir_model.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/ir/ir_qweb/assetsbundle.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/ir/ir_qweb/assetsbundle.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/ir/ir_qweb/qweb.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/ir/ir_qweb/qweb.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/ir/ir_ui_view.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/ir/ir_ui_view.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/module/module.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/module/module.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/res/ir_property.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/res/ir_property.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/res/res.lang.csv" beforeDir="false" afterPath="$PROJECT_DIR$/../base/res/res.lang.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/res/res_config.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/res/res_config.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/res/res_country_data.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../base/res/res_country_data.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/res/res_currency_data.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../base/res/res_currency_data.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/res/res_partner.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/res/res_partner.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/res/res_users.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/res/res_users.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/security/ir.model.access.csv" beforeDir="false" afterPath="$PROJECT_DIR$/../base/security/ir.model.access.csv" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../base/tests/test_ir_http.py" beforeDir="false" afterPath="$PROJECT_DIR$/../base/tests/test_ir_http.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/data/project_email_data.xml" beforeDir="false" afterPath="$PROJECT_DIR$/data/project_email_data.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/models/custom_project.py" beforeDir="false" afterPath="$PROJECT_DIR$/models/custom_project.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/models/custom_timesheet.py" beforeDir="false" afterPath="$PROJECT_DIR$/models/custom_timesheet.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/models/issue_tracker.py" beforeDir="false" afterPath="$PROJECT_DIR$/models/issue_tracker.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/models/project_dashboard.py" beforeDir="false" afterPath="$PROJECT_DIR$/models/project_dashboard.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/report/custom_project_report.py" beforeDir="false" afterPath="$PROJECT_DIR$/report/custom_project_report.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/report/custom_project_report_views.xml" beforeDir="false" afterPath="$PROJECT_DIR$/report/custom_project_report_views.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/static/src/js/project_dashboard.js" beforeDir="false" afterPath="$PROJECT_DIR$/static/src/js/project_dashboard.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/static/src/xml/project_dashboard.xml" beforeDir="false" afterPath="$PROJECT_DIR$/static/src/xml/project_dashboard.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/views/custom_project_view.xml" beforeDir="false" afterPath="$PROJECT_DIR$/views/custom_project_view.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../hrms_dashboard/models/hrms_dashboard.py" beforeDir="false" afterPath="$PROJECT_DIR$/../hrms_dashboard/models/hrms_dashboard.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../hrms_dashboard/static/src/js/hrms_dashboard.js" beforeDir="false" afterPath="$PROJECT_DIR$/../hrms_dashboard/static/src/js/hrms_dashboard.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../hrms_dashboard/static/src/xml/hrms_dashboard.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../hrms_dashboard/static/src/xml/hrms_dashboard.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../hrms_dashboard/views/dashboard_views.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../hrms_dashboard/views/dashboard_views.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../sintranet" beforeDir="false" afterPath="$PROJECT_DIR$/../sintranet" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../sunarc_crm/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../sunarc_crm/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../sunarc_crm/models/crm_lead.py" beforeDir="false" afterPath="$PROJECT_DIR$/../sunarc_crm/models/crm_lead.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../sunarc_crm/views/crm_lead_view.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../sunarc_crm/views/crm_lead_view.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../sunarc_requisition/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/../sunarc_requisition/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../sunarc_requisition/__manifest__.py" beforeDir="false" afterPath="$PROJECT_DIR$/../sunarc_requisition/__manifest__.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../test_main_flows/__init__.py" beforeDir="false" afterPath="$PROJECT_DIR$/../test_main_flows/__init__.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../test_main_flows/__manifest__.py" beforeDir="false" afterPath="$PROJECT_DIR$/../test_main_flows/__manifest__.py" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FUSProjectUsageTrigger">
<session id="1074780780">
<usages-collector id="statistics.lifecycle.project">
<counts>
<entry key="project.closed" value="3" />
<entry key="project.open.time.0" value="1" />
<entry key="project.open.time.1" value="2" />
<entry key="project.open.time.14" value="1" />
<entry key="project.open.time.23" value="1" />
<entry key="project.open.time.6" value="1" />
<entry key="project.opened" value="6" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.open">
<counts>
<entry key="py" value="11" />
<entry key="xml" value="6" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.open">
<counts>
<entry key="Python" value="11" />
<entry key="XML" value="6" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.extensions.edit">
<counts>
<entry key="py" value="5078" />
<entry key="xml" value="334" />
</counts>
</usages-collector>
<usages-collector id="statistics.file.types.edit">
<counts>
<entry key="Python" value="5078" />
<entry key="XML" value="334" />
</counts>
</usages-collector>
</session>
</component>
<component name="FileEditorManager">
<leaf>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/models/issue_tracker.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-593">
<caret line="66" column="4" selection-start-line="66" selection-start-column="4" selection-end-line="66" selection-end-column="4" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/models/custom_master.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/models/custom_project.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="57" column="34" selection-start-line="57" selection-start-column="34" selection-end-line="57" selection-end-column="34" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/models/custom_timesheet.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="810">
<caret line="61" column="16" selection-start-line="61" selection-start-column="16" selection-end-line="61" selection-end-column="16" />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>fix</find>
<find>def create</find>
<find>test_field</find>
<find>_issue_open_count</find>
<find>issue_open_count</find>
<find>reopem</find>
<find>za</find>
<find>bug_find_time</find>
<find>tot</find>
<find>chatt</find>
<find>fixt</find>
<find>total_time</find>
<find>get_total_fixture_time</find>
<find>fixture_time</find>
</findStrings>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
</component>
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/wizard/fixture_time.xml" />
<option value="$PROJECT_DIR$/wizard/fixture_time.py" />
<option value="$PROJECT_DIR$/__manifest__.py" />
<option value="$PROJECT_DIR$/views/custom_project_view.xml" />
<option value="$PROJECT_DIR$/../sunarc_helpdesk/models/helpdesk.py" />
<option value="$PROJECT_DIR$/views/issue_tracker.xml" />
<option value="$PROJECT_DIR$/models/issue_tracker.py" />
<option value="$PROJECT_DIR$/models/custom_timesheet.py" />
</list>
</option>
</component>
<component name="ProjectFrameBounds" extendedState="6">
<option name="x" value="75" />
<option name="y" value="44" />
<option name="width" value="1281" />
<option name="height" value="704" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectView">
<navigator proportions="" version="1">
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="ProjectPane" />
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
<property name="last_opened_file_path" value="$PROJECT_DIR$/../sunarc_helpdesk/models/helpdesk.py" />
</component>
<component name="RunDashboard">
<option name="ruleStates">
<list>
<RuleState>
<option name="name" value="ConfigurationTypeDashboardGroupingRule" />
</RuleState>
<RuleState>
<option name="name" value="StatusDashboardGroupingRule" />
</RuleState>
</list>
</option>
</component>
<component name="SvnConfiguration">
<configuration />
</component>
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="30f22b9e-f2e6-4ea8-b5c0-769f1a75e8c4" name="Default Changelist" comment="" />
<created>1554196611759</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1554196611759</updated>
</task>
<servers />
</component>
<component name="ToolWindowManager">
<frame x="65" y="-4" width="1301" height="772" extended-state="6" />
<editor active="true" />
<layout>
<window_info content_ui="combo" id="Project" order="0" weight="0.24960877" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Favorites" order="2" side_tool="true" />
<window_info anchor="bottom" id="Message" order="0" />
<window_info anchor="bottom" id="Find" order="1" />
<window_info anchor="bottom" id="Run" order="2" />
<window_info anchor="bottom" id="Debug" order="3" weight="0.4" />
<window_info anchor="bottom" id="Cvs" order="4" weight="0.25" />
<window_info anchor="bottom" id="Inspection" order="5" weight="0.4" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Version Control" order="7" />
<window_info anchor="bottom" id="Terminal" order="8" />
<window_info anchor="bottom" id="Event Log" order="9" side_tool="true" />
<window_info anchor="bottom" id="Python Console" order="10" />
<window_info anchor="right" id="Commander" internal_type="SLIDING" order="0" type="SLIDING" weight="0.4" />
<window_info anchor="right" id="Ant Build" order="1" weight="0.25" />
<window_info anchor="right" content_ui="combo" id="Hierarchy" order="2" weight="0.25" />
</layout>
</component>
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/wizard/__init__.py" />
<entry file="file://$PROJECT_DIR$/__init__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
<caret line="5" lean-forward="true" selection-start-line="5" selection-end-line="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/__manifest__.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="405">
<caret line="27" column="28" selection-start-line="27" selection-start-column="28" selection-end-line="27" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/views/custom_project_view.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="240">
<caret line="256" column="64" selection-start-line="256" selection-start-column="64" selection-end-line="256" selection-end-column="64" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/wizard/fixture_time.py" />
<entry file="file://$PROJECT_DIR$/wizard/fixture_time.xml" />
<entry file="file://$PROJECT_DIR$/../sunarc_helpdesk/models/helpdesk.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1162">
<caret line="122" column="33" selection-start-line="122" selection-start-column="33" selection-end-line="122" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/views/issue_tracker.xml">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="46" column="63" selection-start-line="46" selection-start-column="63" selection-end-line="46" selection-end-column="63" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/models/issue_tracker.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-593">
<caret line="66" column="4" selection-start-line="66" selection-start-column="4" selection-end-line="66" selection-end-column="4" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/models/custom_master.py">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/models/custom_project.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="255">
<caret line="57" column="34" selection-start-line="57" selection-start-column="34" selection-end-line="57" selection-end-column="34" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/models/custom_timesheet.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="810">
<caret line="61" column="16" selection-start-line="61" selection-start-column="16" selection-end-line="61" selection-end-column="16" />
</state>
</provider>
</entry>
</component>
</project>

3
field_hide/__init__.py Executable file
View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import models

12
field_hide/__manifest__.py Executable file
View File

@ -0,0 +1,12 @@
# -*- coding: utf-8 -*-
{
'name': "SunArc Field Hide",
'author': "SunArc Technologies",
'website': "http://www.sunarctechnologies.com",
'sequence': 3,
'category': 'Other',
'version': '14.0.1.1',
'depends': ['base','crm', 'project'],
'data': ['views/field_remove_template.xml',],
'application': False
}

3
field_hide/models/__init__.py Executable file
View File

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
from . import field_hide

25
field_hide/models/field_hide.py Executable file
View File

@ -0,0 +1,25 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models, tools, SUPERUSER_ID, _
class ProjectFields(models.Model):
_inherit = "project.project"
@api.model
def get_fields_to_ignore_in_export_in_project(self):
# this function is mainly used for to hide filter from group by
return ['resource_calendar_id', 'website_message_ids', 'warning_employee_rate', 'privacy_visibility']
@api.model
def fields_get(self, allfields=None, attributes=None):
# This function mainly use for hide below field from export
res = super(ProjectFields, self).fields_get(allfields)
for field in self.get_fields_to_ignore_in_export_in_project():
if res.get(field):
res.get(field)['exportable'] = False
return res

View File

@ -0,0 +1,20 @@
odoo.define('module.ControlPanel', function (require) {
'use strict';
var ControlPanel = require('web.ControlPanel');
/* Below function is mainly used for hide field from project export section*/
ControlPanel.include({
_update_search_view: function(searchview, is_hidden) {
this._super.apply(this, arguments);
if(searchview){
this._rpc({
model: 'project.project',
method: 'get_fields_to_ignore_in_export_in_project',
}).then(function (result) {
for(var i=0;i<result.length;i++){
searchview.$buttons.find('option[data-name="' + result[i] + '"]').hide();
}
})
}
},
});
});

View File

@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<template id="assets_backend" name="Project assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside">
<script type="text/javascript" src="/field_hide/static/src/js/field_remove.js"/>
</xpath>
</template>
</data>
</odoo>

View File

@ -57,8 +57,10 @@ class ProjectTimelineReport(models.Model):
durationindex = fields_name.get('duration')
duration = res['datas'][index][durationindex] and float(res['datas'][index][durationindex])
if duration:
duration_time = tools.format_duration(duration)
duration_time = round(duration, 2)
res['datas'][index][durationindex] = duration_time
#duration_time = tools.format_duration(duration)
#res['datas'][index][durationindex] = duration_time
return res
def init(self):

View File

@ -12,7 +12,7 @@
<field name="project_id"/>
<field name="sub_project" widget="many2many_tags"/>
<field name="task_id"/>
<field name="duration" widget="float_time"/>
<field name="duration"/>
<field name="timestamp"/>
<field name="description"/>
</tree>

View File

@ -9,9 +9,10 @@
'license': '',
'depends': ['base', 'project'],
'data': ['views/sub_project.xml',
#'views/analytic_view.xml',
'security/ir.model.access.csv'],
'demo': [''],
'installable': True,
'auto_install': False,
}
}

View File

@ -1 +1,2 @@
from . import sub_project
from . import sub_project
from . import analytic

32
sub_project/models/analytic.py Executable file
View File

@ -0,0 +1,32 @@
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details
from odoo import api, exceptions, fields, models, tools, _
from odoo.exceptions import UserError, AccessError, ValidationError
from odoo.osv import expression
import math
from datetime import datetime, time, timedelta
from odoo.tools.float_utils import float_round
from odoo.tools import DEFAULT_SERVER_DATE_FORMAT, ustr
import dateutil.parser
class AccountAnalyticLineSubProject(models.Model):
_inherit = 'account.analytic.line'
# sub_project = fields.Many2many('project.project', 'project_subproject_timesheet_rel', 'project_id', 'id',
# domain="[('is_sub_project', '=', True),('parent_project', '=', False)]",
# string='Sub Project')
# @api.onchange('project_id')
# def _onchange_parent_project_id(self):
# if self.project_id:
# parent_project = self.env['project.project'].search([('sub_project', '=', self.project_id.id)], limit=1)
# if parent_project:
# self.parent_project = parent_project.id
# else:
# self.parent_project = False
# else:
# self.parent_project = False

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!--<record id="hr_timesheet_line_tree_inherit_subproject" model="ir.ui.view">
<field name="name">account.analytic.line.tree.subproject</field>
<field name="model">account.analytic.line</field>
<field name="inherit_id" ref="hr_timesheet.timesheet_view_tree_user"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='project_id']" position="after">
<field name="sub_project" widget="many2many_tags"/>
</xpath>
</field>
</record>-->
</odoo>