Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: [16.0][ADD] website_event_form #1

Open
wants to merge 1 commit into
base: 16.0
Choose a base branch
from

Conversation

KKamaa
Copy link

@KKamaa KKamaa commented Jan 26, 2024

No description provided.

Copy link

@gfcapalbo gfcapalbo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but attachment not working, and the dates should have date widget.

if event:
return {
'status': 'success',
'message': _('Event submitted successfully!')

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently leaves form open and empty. I think it is okay, the event will be ubnpublished anyway.

id="event_start_date"
name="date_begin"
required="required"
placeholder="2024-01-26 02:39:40"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The place holder should be Insert Date - Mandatory : format YYYY-MM-DD HH:MM:SS
Even better.... to avoid formatting errors use type date and odoo widget date.

id="event_end_date"
name="date_end"
required="required"
placeholder="2024-01-26 02:39:40"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The place holder should be Insert Date - Mandatory : format YYYY-MM-DD HH:MM:SS
Even better.... to avoid formatting errors use type date and odoo widget date.

def website_event_process_form(self, **post):
event_obj = request.env['event.event'].sudo()
try:
event = event_obj.create(post)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The attachment does not appear as the photo of the event_photo or as an attachment to the event. it appears to be lost.


// NB: Save photo file before we submit the form to avoid async
// processes.
document.getElementById('event_photo').addEventListener(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KKamaa the code is fine, but the photo does not appear,.. the object has id=event_photo, but something is not working..

@http.route('/event/process_form', type='json', auth="public",
website=True)
def website_event_process_form(self, **post):
event_obj = request.env['event.event'].sudo()

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the specs say a calendar.event should be created too.
I asked for some clarifications.... perhaps both?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants