dashboar, Academics, configuration save issue fixed
This commit is contained in:
parent
2794ebcb22
commit
3855ed06bb
@ -28,7 +28,7 @@
|
|||||||
<field name="faculty_id"/>
|
<field name="faculty_id"/>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
<templates>
|
<templates>
|
||||||
<t t-name="kanban-box">
|
<t t-name="card">
|
||||||
<div class="oe_kanban_global_click o_kanban_card">
|
<div class="oe_kanban_global_click o_kanban_card">
|
||||||
<div class="oe_kanban_content">
|
<div class="oe_kanban_content">
|
||||||
<div class="o_kanban_record_title font-weight-bold">
|
<div class="o_kanban_record_title font-weight-bold">
|
||||||
@ -144,9 +144,9 @@
|
|||||||
</notebook>
|
</notebook>
|
||||||
</sheet>
|
</sheet>
|
||||||
<div class="oe_chatter">
|
<div class="oe_chatter">
|
||||||
<field name="message_follower_ids"/>
|
<field name="message_follower_ids" widget="mail_followers"/>
|
||||||
<field name="activity_ids"/>
|
<field name="activity_ids" widget="mail_activity"/>
|
||||||
<field name="message_ids"/>
|
<field name="message_ids" widget="mail_thread"/>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -49,11 +49,12 @@ class AcademicYear(models.Model):
|
|||||||
if existing:
|
if existing:
|
||||||
raise ValidationError('Only one academic year can be marked as current for a company.')
|
raise ValidationError('Only one academic year can be marked as current for a company.')
|
||||||
|
|
||||||
@api.model
|
@api.model_create_multi
|
||||||
def create(self, vals):
|
def create(self, vals_list):
|
||||||
if vals.get('state') == 'active':
|
for vals in vals_list:
|
||||||
vals['current_year'] = True
|
if vals.get('state') == 'active':
|
||||||
return super().create(vals)
|
vals['current_year'] = True
|
||||||
|
return super().create(vals_list)
|
||||||
|
|
||||||
def action_activate(self):
|
def action_activate(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
|
|||||||
@ -40,11 +40,12 @@ class EducationCampus(models.Model):
|
|||||||
if similar:
|
if similar:
|
||||||
raise ValidationError('Campus name must be unique within a company.')
|
raise ValidationError('Campus name must be unique within a company.')
|
||||||
|
|
||||||
@api.model
|
@api.model_create_multi
|
||||||
def create(self, vals):
|
def create(self, vals_list):
|
||||||
if vals.get('code'):
|
for vals in vals_list:
|
||||||
vals['code'] = vals['code'].strip().upper()
|
if vals.get('code'):
|
||||||
return super().create(vals)
|
vals['code'] = vals['code'].strip().upper()
|
||||||
|
return super().create(vals_list)
|
||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if 'code' in vals and vals.get('code'):
|
if 'code' in vals and vals.get('code'):
|
||||||
|
|||||||
@ -4,10 +4,10 @@ import { registry } from "@web/core/registry";
|
|||||||
import { Component, onWillStart, onMounted, useState, useRef } from "@odoo/owl";
|
import { Component, onWillStart, onMounted, useState, useRef } from "@odoo/owl";
|
||||||
import { useService } from "@web/core/utils/hooks";
|
import { useService } from "@web/core/utils/hooks";
|
||||||
import { loadJS } from "@web/core/assets";
|
import { loadJS } from "@web/core/assets";
|
||||||
|
import { rpc } from "@web/core/network/rpc";
|
||||||
|
|
||||||
class EducationDashboard extends Component {
|
class EducationDashboard extends Component {
|
||||||
setup() {
|
setup() {
|
||||||
this.rpc = useService("rpc");
|
|
||||||
this.actionService = useService("action");
|
this.actionService = useService("action");
|
||||||
this.state = useState({
|
this.state = useState({
|
||||||
kpis: {},
|
kpis: {},
|
||||||
@ -38,7 +38,7 @@ class EducationDashboard extends Component {
|
|||||||
for (const [k, v] of Object.entries(this.state.filters)) {
|
for (const [k, v] of Object.entries(this.state.filters)) {
|
||||||
params[k] = v ? parseInt(v) : null;
|
params[k] = v ? parseInt(v) : null;
|
||||||
}
|
}
|
||||||
const data = await this.rpc("/web/education/dashboard/kpis", params);
|
const data = await rpc("/web/education/dashboard/kpis", params);
|
||||||
this.state.kpis = data;
|
this.state.kpis = data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -36,11 +36,12 @@ class EducationFeeCategory(models.Model):
|
|||||||
if similar:
|
if similar:
|
||||||
raise ValidationError('Fee category name must be unique within a company.')
|
raise ValidationError('Fee category name must be unique within a company.')
|
||||||
|
|
||||||
@api.model
|
@api.model_create_multi
|
||||||
def create(self, vals):
|
def create(self, vals_list):
|
||||||
if vals.get('code'):
|
for vals in vals_list:
|
||||||
vals['code'] = vals['code'].strip().upper()
|
if vals.get('code'):
|
||||||
return super().create(vals)
|
vals['code'] = vals['code'].strip().upper()
|
||||||
|
return super().create(vals_list)
|
||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if 'code' in vals and vals.get('code'):
|
if 'code' in vals and vals.get('code'):
|
||||||
|
|||||||
@ -89,8 +89,9 @@ class EducationStudentPayment(models.Model):
|
|||||||
ledger_entries.unlink()
|
ledger_entries.unlink()
|
||||||
rec.status = 'cancelled'
|
rec.status = 'cancelled'
|
||||||
|
|
||||||
@api.model
|
@api.model_create_multi
|
||||||
def create(self, vals):
|
def create(self, vals_list):
|
||||||
if not vals.get('receipt_number') or vals.get('receipt_number') == '/':
|
for vals in vals_list:
|
||||||
vals['receipt_number'] = self.env['ir.sequence'].next_by_code('education.student.payment') or '/'
|
if not vals.get('receipt_number') or vals.get('receipt_number') == '/':
|
||||||
return super().create(vals)
|
vals['receipt_number'] = self.env['ir.sequence'].next_by_code('education.student.payment') or '/'
|
||||||
|
return super().create(vals_list)
|
||||||
|
|||||||
@ -76,9 +76,9 @@
|
|||||||
</notebook>
|
</notebook>
|
||||||
</sheet>
|
</sheet>
|
||||||
<div class="oe_chatter">
|
<div class="oe_chatter">
|
||||||
<field name="message_follower_ids"/>
|
<field name="message_follower_ids" widget="mail_followers"/>
|
||||||
<field name="activity_ids"/>
|
<field name="activity_ids" widget="mail_activity"/>
|
||||||
<field name="message_ids"/>
|
<field name="message_ids" widget="mail_thread"/>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
@ -35,11 +35,12 @@ class EducationBatch(models.Model):
|
|||||||
if similar:
|
if similar:
|
||||||
raise ValidationError('Batch name must be unique within a company.')
|
raise ValidationError('Batch name must be unique within a company.')
|
||||||
|
|
||||||
@api.model
|
@api.model_create_multi
|
||||||
def create(self, vals):
|
def create(self, vals_list):
|
||||||
if vals.get('code'):
|
for vals in vals_list:
|
||||||
vals['code'] = vals['code'].strip().upper()
|
if vals.get('code'):
|
||||||
return super().create(vals)
|
vals['code'] = vals['code'].strip().upper()
|
||||||
|
return super().create(vals_list)
|
||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if 'code' in vals and vals.get('code'):
|
if 'code' in vals and vals.get('code'):
|
||||||
@ -78,11 +79,12 @@ class EducationSemester(models.Model):
|
|||||||
if similar:
|
if similar:
|
||||||
raise ValidationError('Semester name must be unique within a company.')
|
raise ValidationError('Semester name must be unique within a company.')
|
||||||
|
|
||||||
@api.model
|
@api.model_create_multi
|
||||||
def create(self, vals):
|
def create(self, vals_list):
|
||||||
if vals.get('code'):
|
for vals in vals_list:
|
||||||
vals['code'] = vals['code'].strip().upper()
|
if vals.get('code'):
|
||||||
return super().create(vals)
|
vals['code'] = vals['code'].strip().upper()
|
||||||
|
return super().create(vals_list)
|
||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if 'code' in vals and vals.get('code'):
|
if 'code' in vals and vals.get('code'):
|
||||||
@ -121,11 +123,12 @@ class EducationSection(models.Model):
|
|||||||
if similar:
|
if similar:
|
||||||
raise ValidationError('Section name must be unique within a company.')
|
raise ValidationError('Section name must be unique within a company.')
|
||||||
|
|
||||||
@api.model
|
@api.model_create_multi
|
||||||
def create(self, vals):
|
def create(self, vals_list):
|
||||||
if vals.get('code'):
|
for vals in vals_list:
|
||||||
vals['code'] = vals['code'].strip().upper()
|
if vals.get('code'):
|
||||||
return super().create(vals)
|
vals['code'] = vals['code'].strip().upper()
|
||||||
|
return super().create(vals_list)
|
||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if 'code' in vals and vals.get('code'):
|
if 'code' in vals and vals.get('code'):
|
||||||
|
|||||||
@ -249,15 +249,16 @@ class EducationStudent(models.Model):
|
|||||||
def action_cancel(self):
|
def action_cancel(self):
|
||||||
self.write({'status': 'cancelled', 'leave_date': fields.Date.today()})
|
self.write({'status': 'cancelled', 'leave_date': fields.Date.today()})
|
||||||
|
|
||||||
@api.model
|
@api.model_create_multi
|
||||||
def create(self, vals):
|
def create(self, vals_list):
|
||||||
if not vals.get('admission_number') or vals.get('admission_number') == '/':
|
for vals in vals_list:
|
||||||
vals['admission_number'] = self.env['ir.sequence'].next_by_code('education.student.admission') or '/'
|
if not vals.get('admission_number') or vals.get('admission_number') == '/':
|
||||||
if not vals.get('student_id') or vals.get('student_id') == '/':
|
vals['admission_number'] = self.env['ir.sequence'].next_by_code('education.student.admission') or '/'
|
||||||
vals['student_id'] = self.env['ir.sequence'].next_by_code('education.student.id') or '/'
|
if not vals.get('student_id') or vals.get('student_id') == '/':
|
||||||
if vals.get('student_id'):
|
vals['student_id'] = self.env['ir.sequence'].next_by_code('education.student.id') or '/'
|
||||||
vals['student_id'] = vals['student_id'].strip().upper()
|
if vals.get('student_id'):
|
||||||
return super().create(vals)
|
vals['student_id'] = vals['student_id'].strip().upper()
|
||||||
|
return super().create(vals_list)
|
||||||
|
|
||||||
def write(self, vals):
|
def write(self, vals):
|
||||||
if 'student_id' in vals and vals.get('student_id'):
|
if 'student_id' in vals and vals.get('student_id'):
|
||||||
|
|||||||
@ -32,7 +32,7 @@
|
|||||||
<field name="status"/>
|
<field name="status"/>
|
||||||
<field name="image"/>
|
<field name="image"/>
|
||||||
<templates>
|
<templates>
|
||||||
<t t-name="kanban-box">
|
<t t-name="card">
|
||||||
<div class="oe_kanban_global_click o_kanban_record_has_image_fill">
|
<div class="oe_kanban_global_click o_kanban_record_has_image_fill">
|
||||||
<t t-if="record.image.raw_value">
|
<t t-if="record.image.raw_value">
|
||||||
<div class="o_kanban_image_fill_left d-none d-md-block" t-attf-style="background-image:url('#{kanban_image('education.student', 'image', record.id.raw_value)}')"/>
|
<div class="o_kanban_image_fill_left d-none d-md-block" t-attf-style="background-image:url('#{kanban_image('education.student', 'image', record.id.raw_value)}')"/>
|
||||||
@ -278,9 +278,9 @@
|
|||||||
</sheet>
|
</sheet>
|
||||||
<!-- Chatter -->
|
<!-- Chatter -->
|
||||||
<div class="oe_chatter">
|
<div class="oe_chatter">
|
||||||
<field name="message_follower_ids"/>
|
<field name="message_follower_ids" widget="mail_followers"/>
|
||||||
<field name="activity_ids"/>
|
<field name="activity_ids" widget="mail_activity"/>
|
||||||
<field name="message_ids"/>
|
<field name="message_ids" widget="mail_thread"/>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user