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

[MIG] [17.0] school_event : Migrated into 17.0 #288

Open
wants to merge 2 commits into
base: 17.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions school_event/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# See LICENSE file for full copyright and licensing details.

{
"name": "School Event Management for Education ERP",
"version": "16.0.1.0.0",
"name": "School Event Management For Education ERP",
"version": "17.0.1.0.0",
"author": "Serpent Consulting Services Pvt. Ltd.",
"website": "http://www.serpentcs.com",
"images": ["static/description/SchoolEvent.png"],
"images": ["static/description/Banner_school_event_17.png"],
"category": "School Management",
"license": "AGPL-3",
"summary": "A Module For Event Management In School",
Expand All @@ -14,6 +14,8 @@
"security/event_security.xml",
"security/ir.model.access.csv",
"views/event_view.xml",
"views/participants.xml",
"views/report_view.xml",
],
"demo": ["demo/event_demo.xml"],
"installable": True,
Expand Down
1 change: 0 additions & 1 deletion school_event/demo/event_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
</record>

<!--school.event.registration-->

<record id="event_registration_1" model="event.registration">
<field name="name">John William - Hockey(Demo-1)</field>
<field name="event_id" ref="school_event_1" />
Expand Down
4 changes: 2 additions & 2 deletions school_event/models/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
class SchoolStandard(models.Model):
_name = "school.standard"
_inherit = "school.standard"
_rec_name = "event_ids"

event_ids = fields.Many2many(
"event.event",
Expand Down Expand Up @@ -54,6 +53,7 @@ class EventRegistration(models.Model):
@api.onchange("part_name_id")
def onchange_student_standard(self):
"""Onchange method for participant"""

self.student_standard_id = self.part_name_id.standard_id.id

def action_set_draft(self):
Expand All @@ -65,4 +65,4 @@ def action_set_draft(self):
"event is ended!"
)
)
return super(EventRegistration, self).action_set_draft()
return super().action_set_draft()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Choose a reason for hiding this comment

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

rename image as an icon.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 1 addition & 13 deletions school_event/views/event_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,6 @@
<xpath expr="//field[@name='tag_ids']" position="after">
<field name="event_type" string='Event Type' />
</xpath>
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
<xpath expr="//field[@name='user_id']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
<xpath expr="//field[@name='organizer_id']" position="attributes">
<field name="string">Supervisor</field>
</xpath>
<xpath expr="//page[@name='event_notes']" position="after">
<page string="Participants">
<field name="part_standard_ids" />
Expand All @@ -32,14 +23,11 @@
<field name="model">event.registration</field>
<field name="inherit_id" ref="event.view_event_registration_form" />
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
<xpath expr="//field[@name='name']" position="before">
<field
name="part_name_id"
domain="[('state','=','done')]"
options="{&quot;no_open&quot;: True, &quot;no_create&quot;: True}"
options="{'no_open': True, 'no_create': True}"
/>
<field name="student_standard_id" />
</xpath>
Expand Down
3 changes: 2 additions & 1 deletion school_event/wizard/terminate_reason.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ class TerminateReasonEvent(models.TransientModel):
def save_terminate(self):
"""Override method to delete event participant and cancel
event registration of student when he is terminated."""

student_rec = self.env["student.student"].browse(self._context.get("active_id"))
event_regi_rec = self.env["event.registration"].search(
[("part_name_id", "=", student_rec.id)]
)
if event_regi_rec:
event_regi_rec.write({"state": "cancel"})
return super(TerminateReasonEvent, self).save_terminate()
return super().save_terminate()