support321 / master-app

A new odoo based module for calls project management
0 stars 1 forks source link

Activities Calendars #7

Open support321 opened 5 years ago

support321 commented 5 years ago

The Calendar of the Lessions and of other activities is the primary and most urgent feature to implement. These activities that are fundamentally calendars entry with a date, a start time and a end time, share unique the resources they use: Teachers, Recipients, Classrooms. The resource are unique, so that a Recipient or a Teacher or a Classroom CANNOT be assigned to another calendar entry that have the same date and time. This constraint is fundamental and mandatory. The calendar management must have a smart import/input system for Lessions date so that:

Also the user can create and manage Classrooms where the activities are carried out. Another functionality for the user is to generate valid course Lession dates, given the teacher and the total hours of that Course. Furthermore an export function that exports in an excel file template the calendar of one given Course.

Current tasks (always on update, for history follow the comments)

Lesson

Course

support321 commented 5 years ago

Task

Every lession must not overlap for the same date/time the following resources (fields):

support321 commented 5 years ago

@BoubakerAB shouldn't this be One2many? One lession has got many beneficiaries (or recipients, perhaps it sounds better that beneficiaries)

beneficiaries_id = fields.One2many('hr.employee','lesson_id', string="Beneficiaries")
support321 commented 5 years ago

review 1

Course:

support321 commented 5 years ago

review 1

Lessions:

Recipients problem

Now, here is a problem to solve with the recipient concept. A recipient can resign from an active project so, we can have for one course that, a number of lessions, have certain recipient (A, B, C, D, E) and the rest of the lessions have less or different recipients (B,C, E, F, G). So, it is good to have beneficiaries for every single lessions but from a user point of view there should a comprehensive list of recipients at course level. What's the best way to do this? 1) Have a separate field list of recipients in the Course that have to be synchronized with the every lessions recipients list OR 2) have a generated view of the unique recipients of all the lessions of that course?

Possible recipient workflow with course lessions:

When a Course is created the recipients are added to the recipient course list BUT the list can change until the end of the course, an example: 1) a new course is created with the following recipients: Anna, Michael, Jack and Terry 2) two Lessions are then created related to the course. The recipients of those lessions are Anna, Michael, Jack, Terry 3) after that, Anna withdraw from the course so she will not be recipient for any other lession of that course. Still, the lession hours that she made before her withdrawal are valid 4) to replace Anna, a new recipient is added to the course: Carl. From now on the recipients of the course lessions will be Michael, Jack, Terry and Carl 5) after the replacement, new lessions are created. The lession recipients of these lessions are only Michael, Jack, Terry and Carl. (Other recipient replacements can be done in the same way throughout the duration of the course) 6) at the end of the course the complete list of recipients are: Anna, Michael, Jack, Terry and Carl

recipient-workflow.pdf

support321 commented 5 years ago

review for committ b31e37b

Course

Lessions

Place

support321 commented 5 years ago

Review for commit 34436d1

Resolved the lessons date check that was very important, we have to plan to make the same functionality for CSV import.

BoubakerAB commented 5 years ago

The problem when I put the widget in the Float field (float_time) the lesson check function appears error, it does not work properly

support321 commented 5 years ago

The problem when I put the widget in the Float field (float_time) the lesson check function appears error, it does not work properly

Ok, maybe I can help you with that while you focus on something more important

BoubakerAB commented 5 years ago

You can test in your local machine in the file gest_call > views > _lessonview.xml change his lines: <field name="start_time" /> <field name="end_time" />

by that

 <field name="start_time" widget='float_time'/>
                            <field name="end_time" widget='float_time'/>

then update the module and tested

support321 commented 5 years ago

I edited the widgets directly in odoo debug mode and it seems tu run smoothly immagine immagine

The only problem would be if the user input a float number "10.30" and not a time "10:30". Also, it's not restrained to the 24 day hours, I believe is rendered like a time interval and not a datetime hour

BoubakerAB commented 5 years ago

I think you have not tested adding more lessons in the same date and time because if you added the widget it does not do a good check if there is a lesson in this date

support321 commented 5 years ago

I think you have not tested adding more lessons in the same date and time because if you added the widget it does not do a good check if there is a lesson in this date

I tried what you said, I created a new lession with same day/hours/teacher/course/place and the error popped up. I even tried to input hours with the hh:mm format and with the float version, the check is being done. I will try to test it more to see if there's something off.

support321 commented 5 years ago

review for 1259ee6

Lesson

Course

support321 commented 5 years ago

I tried to create a calendar view for the lessons like this

<record id="action_gestcal_calendar_view" model="ir.ui.view">
    <field name="name">gestcal.lesson.calendar</field>
    <field name="model">gestcal.lesson</field>
    <field name="priority" eval="2"/>
    <field name="arch" type="xml">
        <calendar string="Lessons" date_start="date" event_open_popup="true" event_limit="5" color="course_id">
            <field name="date"/>
            <field name="course_id"/>
        </calendar>
    </field>
</record>

but I think I'm totally missing something

BoubakerAB commented 5 years ago

It's good your code works but you forgot to add in the record ir.actions.act_window check this line and add calendar <field name="view_mode">calendar,tree,form</field>


        <!-- Actions Of Form & Tree Views Of lesson Information -->
        <record id="action_gestcal_lesson_view" model="ir.actions.act_window">
            <field name="name">Lesson</field>
            <field name="res_model">gestcal.lesson</field>
            <field name="view_type">form</field>
            <field name="view_mode">calendar,tree,form</field>
        </record>