Merge branch 'pawan_branch' into 'development'
add date from datetime See merge request prakash.jain/cor-odoo!117
This commit is contained in:
commit
74621ff255
|
@ -8,6 +8,7 @@ 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 AccountAnalyticLine(models.Model):
|
||||
|
@ -161,3 +162,8 @@ class AccountAnalyticLine(models.Model):
|
|||
if self.project_id:
|
||||
self.project_id._onchange_calculate_timesheet_hours()
|
||||
return res
|
||||
|
||||
@api.onchange('start_datetime', 'end_datetime')
|
||||
def _onchange_start_end_date(self):
|
||||
if self.start_datetime:
|
||||
self.date = self.start_datetime.date()
|
||||
|
|
|
@ -64,8 +64,8 @@
|
|||
<field name="name">account.analytic.line.tree.hr_timesheet</field>
|
||||
<field name="model">account.analytic.line</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Timesheet Activities" sample="1">
|
||||
<field name="date"/>
|
||||
<tree editable="top" string="Timesheet Activities" sample="1">
|
||||
<field name="date" readonly="1" invisible="1"/>
|
||||
<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',}"/>
|
||||
|
@ -75,8 +75,8 @@
|
|||
<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 date"/><!--custom-->
|
||||
<field name="end_datetime" string="End date"/><!--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 > 24"/>
|
||||
<field name="parent_project"/><!--custom-->
|
||||
|
@ -161,20 +161,20 @@
|
|||
</group>
|
||||
<group>
|
||||
<group>
|
||||
<field name="date"/>
|
||||
<field name="project_id" required="1"
|
||||
context="{'form_view_ref': 'project.project_project_view_form_simplified',}"/>
|
||||
<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"/>
|
||||
<field name="date" readonly="1"/>
|
||||
</group>
|
||||
<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 date"/><!--custom-->
|
||||
<field name="end_datetime" string="End date"/><!--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 > 24"/>
|
||||
<field name="currency_id" invisible="1"/>
|
||||
</group>
|
||||
|
|
Loading…
Reference in New Issue