Browse Source

Merge PR #1221 into 14.0

Signed-off-by max3903
14.0
OCA-git-bot 3 years ago
parent
commit
af27425884
  1. 2
      animal/models/animal_breed.py
  2. 2
      animal/models/animal_species.py
  3. 2
      animal/security/ir.model.access.csv
  4. 8
      animal/views/animal_breed.xml
  5. 8
      animal/views/animal_species.xml
  6. 2
      animal_owner/views/animal.xml

2
animal/models/animal_breed.py

@ -10,3 +10,5 @@ class AnimalBreed(models.Model):
name = fields.Char(string="Name", translate=True)
species_id = fields.Many2one("animal.species", string="Species", required=True)
active = fields.Boolean(default=True)
sequence = fields.Integer()

2
animal/models/animal_species.py

@ -9,4 +9,6 @@ class AnimalSpecies(models.Model):
_order = "name"
name = fields.Char(string="Name", translate=True)
active = fields.Boolean(default=True)
sequence = fields.Integer()
breed_ids = fields.One2many("animal.breed", "species_id", string="Breeds")

2
animal/security/ir.model.access.csv

@ -5,4 +5,4 @@ access_animal_color_manager,animal.color.manaager,model_animal_color,animal.grou
access_animal_breed_user,animal.breed.user,model_animal_breed,base.group_user,1,0,0,0
access_animal_breed_manager,animal.breed.manager,model_animal_breed,animal.group_animal_manager,1,1,1,1
access_animal_species_user,animal.species.user,model_animal_species,base.group_user,1,0,0,0
access_animal_species_manager,animal.species.manager,model_animal_species,animal.group_animal_manager,1,1,1,0
access_animal_species_manager,animal.species.manager,model_animal_species,animal.group_animal_manager,1,1,1,1

8
animal/views/animal_breed.xml

@ -6,6 +6,7 @@
<field name="model">animal.breed</field>
<field name="arch" type="xml">
<tree string="Breeds">
<field name="sequence" widget="handle" />
<field name="name" />
<field name="species_id" />
</tree>
@ -21,6 +22,13 @@
<header />
<sheet>
<div class="oe_button_box" name="button_box" />
<widget
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
/>
<field name="active" invisible="1" />
<div class="oe_title">
<h1>
<field name="name" />

8
animal/views/animal_species.xml

@ -6,6 +6,7 @@
<field name="model">animal.species</field>
<field name="arch" type="xml">
<tree string="Species">
<field name="sequence" widget="handle" />
<field name="name" />
</tree>
</field>
@ -20,6 +21,13 @@
<header />
<sheet>
<div class="oe_button_box" name="button_box" />
<widget
name="web_ribbon"
title="Archived"
bg_color="bg-danger"
attrs="{'invisible': [('active', '=', True)]}"
/>
<field name="active" invisible="1" />
<div class="oe_title">
<h1>
<field name="name" />

2
animal_owner/views/animal.xml

@ -18,7 +18,7 @@
<field name="model">animal</field>
<field name="inherit_id" ref="animal.view_animal_form" />
<field name="arch" type="xml">
<field name="birth_date" position="after">
<field name="species_id" position="after">
<field name="partner_id" />
</field>
</field>

Loading…
Cancel
Save