Skip to content

Commit

Permalink
[FIX]odoo_academic: Sequence on groups
Browse files Browse the repository at this point in the history
closes #68

Signed-off-by: Matias Peralta <mnp@adhoc.com.ar>
  • Loading branch information
JrAdhoc committed May 20, 2022
1 parent 233a87d commit 3cc7394
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion academic/__manifest__.py
Expand Up @@ -19,7 +19,7 @@
##############################################################################
{
'name': 'Academic',
'version': '13.0.1.5.0',
'version': '13.0.1.6.0',
'sequence': 14,
'summary': '',
'author': 'ADHOC SA',
Expand Down
3 changes: 3 additions & 0 deletions academic/models/academic_group.py
Expand Up @@ -11,6 +11,7 @@
class AcademicGroup(models.Model):
_name = 'academic.group'
_description = 'group'
_order = 'sequence'

type = fields.Selection([
('student', 'Student'),
Expand Down Expand Up @@ -71,6 +72,8 @@ class AcademicGroup(models.Model):
'unique(subject_id, company_id, level_id, year, division_id)',
'Group should be unique per Institution, Subject,'
' Course-Division and Year')]

sequence = fields.Integer(help='Used to order Groups', default=10)

def name_get(self):
# always return the full hierarchical name
Expand Down
2 changes: 2 additions & 0 deletions academic/views/academic_group_views.xml
Expand Up @@ -41,6 +41,7 @@
<field name="level_id" domain="[('id','in',study_plan_level_ids)]"/>
<field name="division_id" required="1"/>
<field name="year"/>
<field name="sequence"/>
</group>
<notebook>
<page name="students" string="Students">
Expand All @@ -61,6 +62,7 @@
<field name="arch" type="xml">
<tree string="group">
<!-- <field name="type"/> -->
<field name="sequence" widget="handle"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="level_id"/>
<field name="division_id"/>
Expand Down

0 comments on commit 3cc7394

Please sign in to comment.