1
votes

In ODOO v10, I have created a wizard under the action menu in stock.picking which should get all the values from a selected record. The wizard contains a create button, which is to create a record in the fleet.vehicle model.

1

1 Answers

1
votes

Like this

@api.multi
def apply_compoff(self):

    holiday_status_id = self.env.ref('lms.comp_off').id

    if self.comp_off_type == 'full':
        number_of_days_temp = 1
    else:
        number_of_days_temp = 0.5

    compoff_request_id = self.env['hr.holidays'].create({
        'name': self.name,
        'employee_id': self.employee_id.id,
        'manager_id': self.reporting_to.id,
        'type': 'add',
        'holiday_status_id':holiday_status_id,
        'number_of_days_temp':number_of_days_temp,
        'state':'confirm',
        'compoff_date':self.comp_off_date,
        'date_to':self.comp_off_date,
        'date_from':self.comp_off_date,
        'leave_code':'CPO',
        'leave_summary_id':self.employee_id.leave_summary_id.id,
        'reporting_to_id':self.reporting_to.id
    })

apply_compoff is type="object", So in your create button set the value for fleet.vehicle in dictionary