Open support321 opened 5 years ago
Every lession must not overlap for the same date/time the following resources (fields):
@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")
Course:
Repetition is an identificative human-readable number for identical courses within one project that have:
This means that there cannot be two "twin" Course with the same repetition number. Repetition starts from 1. Also, Repetition numbers should be appended when course titles are displayed within a project form view (this is not top priority, you will tell me if its a task easy to do or not).
Lessions:
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?
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
b31e37b
34436d1
Resolved the lessons date check that was very important, we have to plan to make the same functionality for CSV import.
The problem when I put the widget in the Float field (float_time) the lesson check function appears error, it does not work properly
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
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
I edited the widgets directly in odoo debug mode and it seems tu run smoothly
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
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 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.
1259ee6
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
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>
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
start_time
andend_time
issues we must plan to modify the import function for lessons. Most of the work will be the function to convert the time value from the CSV file that can be in different formats (like "20:50" or "20.50". Luckly it never will be like 10.50 PM)start date
andend date
should accept time format 24h only and not float-like numbers like "15.70". _This is on standby because of the floattime widget problem.Course
res.partner.category
tags: many2many and many2many_tags widget.