This question has been flagged
1 Reply
3708 Views

Hello, In time sheet Module I am creating many2one field project activity

class hr_timesheet_line(osv.osv):

_inherit = "hr.analytic.timesheet"

_columns = {
                'activity':fields.many2one('hr.timesheet.activities', 'Activity'),
                 <new_field_name> :fields.<field type>(??????)
           }

This field is changes with respective project.

Then In hr.timesheet.activities this class I mentioned

 class hr_timesheet_activities(osv.osv):

_name = "hr.timesheet.activities"
_columns = {

          'name': fields.char('Activity Name', size = 64,required = True),
          'related_account_id': fields.many2one("account.analytic.account", 'Project / Account ID',required = True),
          'activity':fields.text('Activity Description'),
          'minimum_amount_activity':fields.selection([("00.15", "00:15"),("00.30", "00:30"),("00.45", "00:45"), ("0.60", "01:00"),("00.75", "01:15"),("00.90", "01:30"), ("01.05", "01:45"), ("01.20", "02:00")],"Select Minimum time Span for Activity", required = True),
          'maximum_amount_activity':fields.many2one("activity.amount.hours", "Select Maximum time for Activity", required = True),
          }

For this class view --> "hr_timesheet_line if I select project activity and details for that activity are as follows

name : project Activity1
related_account_id : Project1
minimum_amount_activity :00:30
maximum_amount_activity: 4.00

Then In hr_timesheet_line form view I want one new selection field having selection values are(00:30,01:00,01:30,02:00....,04:00)

How I create new field which is dynamically changes with "activity" field from hr.analytic.timesheet class.?

Help In --> to create new_field --> fields.type ? functionality ?

Avatar
Discard
Best Answer

Hi, 

You can follow following link for this:

https://youtu.be/GPhgxxwprA4

Hope it helps,

Thanks

Avatar
Discard