Browse Source
[MIG] animal: Migration to 14.0
[MIG] animal: Migration to 14.0
[FIX] animal: Modified by pre-commit [FIX] animal: Replaced status button by archived widget14.0
joseph
4 years ago
committed by
Joseph Armas
9 changed files with 299 additions and 289 deletions
-
1README.md
-
10animal/README.rst
-
2animal/i18n/animal.pot
-
174animal/i18n/es.po
-
6animal/static/description/index.html
-
392animal/views/animal.xml
-
1animal/views/animal_breed.xml
-
1animal/views/animal_color.xml
-
1animal/views/animal_species.xml
@ -1,216 +1,216 @@ |
|||
<odoo> |
|||
<data> |
|||
<!-- Animal Tree View --> |
|||
<record id="view_animal_tree" model="ir.ui.view"> |
|||
<field name="name">animal.tree</field> |
|||
<field name="model">animal</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Animals"> |
|||
<field name="ref" /> |
|||
<field name="name" /> |
|||
<field name="gender" /> |
|||
<field name="species_id" /> |
|||
<field name="breed_id" /> |
|||
<field name="color_id" /> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<!-- Animal Tree View --> |
|||
<record id="view_animal_tree" model="ir.ui.view"> |
|||
<field name="name">animal.tree</field> |
|||
<field name="model">animal</field> |
|||
<field name="arch" type="xml"> |
|||
<tree string="Animals"> |
|||
<field name="ref" /> |
|||
<field name="name" /> |
|||
<field name="gender" /> |
|||
<field name="species_id" /> |
|||
<field name="breed_id" /> |
|||
<field name="color_id" /> |
|||
</tree> |
|||
</field> |
|||
</record> |
|||
|
|||
<!-- Animal Form View --> |
|||
<record id="view_animal_form" model="ir.ui.view"> |
|||
<field name="name">animal.form</field> |
|||
<field name="model">animal</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Animal"> |
|||
<header /> |
|||
<sheet> |
|||
<div class="oe_button_box" name="button_box"> |
|||
<button |
|||
name="toggle_active" |
|||
type="object" |
|||
class="oe_stat_button" |
|||
icon="fa-archive" |
|||
> |
|||
<!-- Animal Form View --> |
|||
<record id="view_animal_form" model="ir.ui.view"> |
|||
<field name="name">animal.form</field> |
|||
<field name="model">animal</field> |
|||
<field name="arch" type="xml"> |
|||
<form string="Animal"> |
|||
<sheet> |
|||
<widget |
|||
name="web_ribbon" |
|||
title="Archived" |
|||
bg_color="bg-danger" |
|||
attrs="{'invisible': [('active', '=', True)]}" |
|||
/> |
|||
<field name="active" invisible="1" /> |
|||
<field name="image" widget='image' class="oe_avatar" /> |
|||
<div class="oe_title"> |
|||
<h1> |
|||
<field name="name" /> |
|||
</h1> |
|||
<field |
|||
name="active" |
|||
widget="boolean_button" |
|||
options='{"terminology": "archive"}' |
|||
name="gender" |
|||
widget="radio" |
|||
options="{'horizontal': true}" |
|||
/> |
|||
</button> |
|||
</div> |
|||
<field name="image" widget='image' class="oe_avatar" /> |
|||
<div class="oe_title"> |
|||
<h1> |
|||
<field name="name" /> |
|||
</h1> |
|||
</div> |
|||
<group id="main"> |
|||
<group id="left"> |
|||
<field name="species_id" /> |
|||
<field |
|||
name="breed_id" |
|||
domain="[('species_id', '=', species_id)]" |
|||
/> |
|||
<field |
|||
name="color_id" |
|||
domain="[('breed_id', '=', breed_id)]" |
|||
/> |
|||
<field name="size" /> |
|||
</group> |
|||
<group id="right"> |
|||
<field name="ref" /> |
|||
<field name="weight" /> |
|||
<field name="birth_date" /> |
|||
</group> |
|||
</group> |
|||
</sheet> |
|||
<div class="oe_chatter"> |
|||
<field name="message_follower_ids" widget="mail_followers" /> |
|||
<field name="activity_ids" widget="mail_activity" /> |
|||
<field |
|||
name="gender" |
|||
widget="radio" |
|||
options="{'horizontal': true}" |
|||
name="message_ids" |
|||
widget="mail_thread" |
|||
options="{'post_refresh': 'recipients'}" |
|||
/> |
|||
</div> |
|||
<group id="main"> |
|||
<group id="left"> |
|||
<field name="species_id" /> |
|||
<field |
|||
name="breed_id" |
|||
domain="[('species_id', '=', species_id)]" |
|||
/> |
|||
<field |
|||
name="color_id" |
|||
domain="[('breed_id', '=', breed_id)]" |
|||
/> |
|||
<field name="size" /> |
|||
</group> |
|||
<group id="right"> |
|||
<field name="ref" /> |
|||
<field name="weight" /> |
|||
<field name="birth_date" /> |
|||
</group> |
|||
</group> |
|||
<notebook /> |
|||
</sheet> |
|||
<div class="oe_chatter"> |
|||
<field name="message_follower_ids" widget="mail_followers" /> |
|||
<field name="activity_ids" widget="mail_activity" /> |
|||
<field |
|||
name="message_ids" |
|||
widget="mail_thread" |
|||
options="{'post_refresh': 'recipients'}" |
|||
/> |
|||
</div> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
|
|||
<!-- Animal Kanban View --> |
|||
<record id="view_animal_kanban" model="ir.ui.view"> |
|||
<field name="name">animal.kanban</field> |
|||
<field name="model">animal</field> |
|||
<field name="arch" type="xml"> |
|||
<kanban class="o_res_partner_kanban"> |
|||
<field name="id" /> |
|||
<field name="image" /> |
|||
<field name="name" /> |
|||
<templates> |
|||
<t t-name="kanban-box"> |
|||
<div |
|||
class="oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban" |
|||
> |
|||
<t t-if="record.image.raw_value"> |
|||
<img |
|||
class="o_kanban_image" |
|||
t-att-src="kanban_image('animal', 'image', record.id.raw_value)" |
|||
t-att-alt="record.name" |
|||
/> |
|||
</t> |
|||
<t t-else=""> |
|||
<img |
|||
class="o_kanban_image" |
|||
alt="Avatar" |
|||
t-att-src='_s + "/animal/static/img/avatar.png"' |
|||
/> |
|||
</t> |
|||
<div class="oe_kanban_details"> |
|||
<strong |
|||
class="o_kanban_record_title oe_partner_heading" |
|||
><field name="display_name" /></strong> |
|||
<div |
|||
class="o_kanban_tags_section oe_kanban_partner_categories" |
|||
/> |
|||
<ul> |
|||
<li t-if="record.gender.raw_value"><field |
|||
name="gender" |
|||
/></li> |
|||
<li |
|||
t-if="record.species_id.raw_value and record.breed_id.raw_value" |
|||
><field name="breed_id" />, <field |
|||
name="species_id" |
|||
/></li> |
|||
</ul> |
|||
<div class="oe_kanban_partner_links" /> |
|||
<!-- Animal Kanban View --> |
|||
<record id="view_animal_kanban" model="ir.ui.view"> |
|||
<field name="name">animal.kanban</field> |
|||
<field name="model">animal</field> |
|||
<field name="arch" type="xml"> |
|||
<kanban class="o_res_partner_kanban"> |
|||
<field name="id" /> |
|||
<field name="image" /> |
|||
<field name="name" /> |
|||
<templates> |
|||
<t t-name="kanban-box"> |
|||
<div |
|||
class="oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban" |
|||
> |
|||
<t t-if="record.image.raw_value"> |
|||
<img |
|||
class="o_kanban_image" |
|||
t-att-src="kanban_image('animal', 'image', record.id.raw_value)" |
|||
t-att-alt="record.name" |
|||
/> |
|||
</t> |
|||
<t t-else=""> |
|||
<img |
|||
class="o_kanban_image" |
|||
alt="Avatar" |
|||
t-att-src='_s + "/animal/static/img/avatar.png"' |
|||
/> |
|||
</t> |
|||
<div class="oe_kanban_details"> |
|||
<strong |
|||
class="o_kanban_record_title oe_partner_heading" |
|||
><field name="display_name" /></strong> |
|||
<div |
|||
class="o_kanban_tags_section oe_kanban_partner_categories" |
|||
/> |
|||
<ul> |
|||
<li t-if="record.gender.raw_value"><field |
|||
name="gender" |
|||
/></li> |
|||
<li |
|||
t-if="record.species_id.raw_value and record.breed_id.raw_value" |
|||
><field name="breed_id" />, <field |
|||
name="species_id" |
|||
/></li> |
|||
</ul> |
|||
<div class="oe_kanban_partner_links" /> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</templates> |
|||
</kanban> |
|||
</field> |
|||
</record> |
|||
</t> |
|||
</templates> |
|||
</kanban> |
|||
</field> |
|||
</record> |
|||
|
|||
<!-- Search for animal --> |
|||
<record id="view_animal_search" model="ir.ui.view"> |
|||
<field name="name">animal.search</field> |
|||
<field name="model">animal</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Animals"> |
|||
<field |
|||
name="name" |
|||
filter_domain="['|', ('name', 'ilike', self), ('ref', 'ilike', self)]" |
|||
string="Name" |
|||
/> |
|||
<field name="species_id" /> |
|||
<field name="breed_id" /> |
|||
<field name="color_id" /> |
|||
<field name="size" /> |
|||
<separator /> |
|||
<filter |
|||
string="Female" |
|||
domain="[('gender', '=', 'female')]" |
|||
name="female" |
|||
/> |
|||
<filter string="Male" domain="[('gender', '=', 'male')]" name="male" /> |
|||
<filter |
|||
string="Hermaphrodite" |
|||
domain="[('gender', '=', 'hermaphrodite')]" |
|||
name="hermaphrodite" |
|||
/> |
|||
<filter |
|||
string="Neutered" |
|||
domain="[('gender', '=', 'neutered')]" |
|||
name="neutered" |
|||
/> |
|||
<separator /> |
|||
<group expand="0" string="Group By"> |
|||
<!-- Search for animal --> |
|||
<record id="view_animal_search" model="ir.ui.view"> |
|||
<field name="name">animal.search</field> |
|||
<field name="model">animal</field> |
|||
<field name="arch" type="xml"> |
|||
<search string="Animals"> |
|||
<field |
|||
name="name" |
|||
filter_domain="['|', ('name', 'ilike', self), ('ref', 'ilike', self)]" |
|||
string="Name" |
|||
/> |
|||
<field name="species_id" /> |
|||
<field name="breed_id" /> |
|||
<field name="color_id" /> |
|||
<field name="size" /> |
|||
<separator /> |
|||
<filter |
|||
name="gender" |
|||
string="Gender" |
|||
domain="" |
|||
context="{'group_by': 'gender'}" |
|||
string="Female" |
|||
domain="[('gender', '=', 'female')]" |
|||
name="female" |
|||
/> |
|||
<filter |
|||
name="species_id" |
|||
string="Species" |
|||
domain="" |
|||
context="{'group_by': 'species_id'}" |
|||
string="Male" |
|||
domain="[('gender', '=', 'male')]" |
|||
name="male" |
|||
/> |
|||
<filter |
|||
name="breed_id" |
|||
string="Breed" |
|||
domain="" |
|||
context="{'group_by': 'breed_id'}" |
|||
string="Hermaphrodite" |
|||
domain="[('gender', '=', 'hermaphrodite')]" |
|||
name="hermaphrodite" |
|||
/> |
|||
<filter |
|||
name="color_id" |
|||
string="Color" |
|||
domain="" |
|||
context="{'group_by': 'color_id'}" |
|||
string="Neutered" |
|||
domain="[('gender', '=', 'neutered')]" |
|||
name="neutered" |
|||
/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_animal" model="ir.actions.act_window"> |
|||
<field name="name">Animals</field> |
|||
<field name="res_model">animal</field> |
|||
<field name="view_type">form</field> |
|||
<field name="view_mode">kanban,tree,form</field> |
|||
<field name="search_view_id" ref="view_animal_search" /> |
|||
<field name="help" type="html"> |
|||
<p class="o_view_nocontent_smiling_face"> |
|||
Create an animal. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
<separator /> |
|||
<filter |
|||
string="Archived" |
|||
name="inactive" |
|||
domain="[('active', '=', False)]" |
|||
/> |
|||
<separator /> |
|||
<group expand="0" string="Group By"> |
|||
<filter |
|||
name="gender" |
|||
string="Gender" |
|||
domain="" |
|||
context="{'group_by': 'gender'}" |
|||
/> |
|||
<filter |
|||
name="species_id" |
|||
string="Species" |
|||
domain="" |
|||
context="{'group_by': 'species_id'}" |
|||
/> |
|||
<filter |
|||
name="breed_id" |
|||
string="Breed" |
|||
domain="" |
|||
context="{'group_by': 'breed_id'}" |
|||
/> |
|||
<filter |
|||
name="color_id" |
|||
string="Color" |
|||
domain="" |
|||
context="{'group_by': 'color_id'}" |
|||
/> |
|||
</group> |
|||
</search> |
|||
</field> |
|||
</record> |
|||
|
|||
<record id="action_animal" model="ir.actions.act_window"> |
|||
<field name="name">Animals</field> |
|||
<field name="res_model">animal</field> |
|||
<field name="view_mode">kanban,tree,form</field> |
|||
<field name="search_view_id" ref="view_animal_search" /> |
|||
<field name="help" type="html"> |
|||
<p class="o_view_nocontent_smiling_face"> |
|||
Create an animal. |
|||
</p> |
|||
</field> |
|||
</record> |
|||
</data> |
|||
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue