Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

calendar view with one2many fields ?

By
tarek
on 4/9/16, 11:00 AM 405 views

i want to make calendar view for planning of employee 

inherit = 'hr.employee'

_columns = {

'planing_line': fields.one2many('asc.rental.contract','rental_employ_id','planning driver'),

'is_driver': fields.boolean(' is driver'),

}

model  (asc.rental.contract) contain start_date and  end_date

how i can make calendar view for many period 

0
ELIASS BENFATEH
On 4/11/16, 6:21 AM

You can't: the Calendar view supports only one date field. For the effect you want you need four event records.

I suggest this design:

  • add to proevents.events a child model (one-to-many relation), proevents.events.date, to store the date records you need, and expected to have four rows.
  • have the calendar view use proevents.events.date.

Depending on your specific use case, you might need to add some logic to ensure that the four date lines are added for each event.

Note: your model should be named in singular and with the underlying main module as the first word: event.provevent.

0
tarek
On 4/10/16, 4:32 AM

thank you for help 


0

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 4/10/16, 1:18 AM

Hi,

You can make the calendar in the asc.rental.contract and make the color in the employee_id field ..

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/9/16, 11:00 AM
Seen: 405 times
Last updated: 4/11/16, 6:21 AM