Closed askz closed 7 years ago
HI @askz - Apologies, but I think I am missing something here. I don't see any inheritance w/ calendar modules in your branch.
(Although I totally agree with your logic of inheriting from core - these medical modules duplicate a lot of logic and model attributes that exist in Odoo)
Hi @lasley! Sorry I should guide you, check this out.
I didn't worked a lot on medical module, just some tuning to meet my needs. The important part is in medical_appointment_invoice. I was first coding automatic generation of an invoice when an appointment was done - this part's gonna be improved and gonna be more dynamic in the future, it's just some introduction and tests.
It's really WIP right now so don't be too hard w/me ahah, thanks in advance!
Awesome, thanks @askz
I am kind of confused though, as the error is being thrown due to calendar.attendee
insert/update constraint violation, not a calendar.event
, which is what the model is inheriting from.
Are you using calendar.attendee
anywhere in your branch, or is this somehow bubbling directly from the medical.appointment.new
model/inheritance chain?
Yup me too, at the beginning this was about calendar.event and after I added calendar_attendee and res_partner class and now I still can't create an appointment. And I can confirm I use it just on this file and in the corresponding view medical_appointment.xml And in fact the actual calendar.event code and other snippets from other models helped me to understand a lot to understand how's working
Hi @askz I took a look at your code, and the issue lies in https://github.com/BusinessAgile/vertical-medical/blob/recurrency/medical_appointment_invoice/models/medical_appointment.py#L62
You'll see that it tries to use event_id - https://github.com/odoo/odoo/blob/f9688cc63f6f89081c649ff365dcd738f0eff26e/addons/calendar/calendar.py#L1072
But I am betting that it is null (empty recordset) in your test case.
Hi @askz - any updates on this?
Hi @lasley !
I had totally forgotten this issue since I'm not using anymore the vertical-medical modules. I finally managed to inherit calendar.event with my own module from scratch and it works like a charm !
So I think we can close that.
Thanks for your help :)
Hi, I'm trying to enhance your appointment's module by inherit calendar.event instead of re-create a calendar. The main goal is to get native event recurrence and attendee's functionality, or maybe I'm wrong with doing that and I need to create my recurrence code in appointments? (not sure ahah) I'm pretty new in odoo development but I made the whole part I think. There's an error when I'm trying to create an appointment saying that :
I'll be glad to hear advices I must forget something. The actual work is here https://github.com/BusinessAgile/vertical-medical/tree/recurrency Don't bother of appointment cluster's it isn't the problem.
Thanks for your good work.