Browse Source

[IMP] animal: black, isort, prettier

14.0
joseph 4 years ago
parent
commit
f839fc2c0a
  1. 2
      animal/__manifest__.py
  2. 7
      animal/security/res_groups.xml
  3. 198
      animal/views/animal.xml
  4. 16
      animal/views/animal_breed.xml
  5. 20
      animal/views/animal_color.xml
  6. 14
      animal/views/animal_species.xml
  7. 77
      animal/views/menu.xml
  8. 1
      setup/animal/odoo/addons/animal
  9. 6
      setup/animal/setup.py

2
animal/__manifest__.py

@ -2,7 +2,7 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{ {
"name": "Animal", "name": "Animal",
"version": "12.0.1.0.0",
"version": "14.0.1.0.0",
"license": "AGPL-3", "license": "AGPL-3",
"summary": "Manage animals information", "summary": "Manage animals information",
"author": "Open Source Integrators, Odoo Community Association (OCA)", "author": "Open Source Integrators, Odoo Community Association (OCA)",

7
animal/security/res_groups.xml

@ -3,8 +3,11 @@
<!-- Animal groups --> <!-- Animal groups -->
<record id="group_animal_manager" model="res.groups"> <record id="group_animal_manager" model="res.groups">
<field name="name">Manager</field> <field name="name">Manager</field>
<field name="category_id" ref="animal"/>
<field name="users" eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"/>
<field name="category_id" ref="animal" />
<field
name="users"
eval="[(4, ref('base.user_root')), (4, ref('base.user_admin'))]"
/>
</record> </record>
</odoo> </odoo>

198
animal/views/animal.xml

@ -6,12 +6,12 @@
<field name="model">animal</field> <field name="model">animal</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Animals"> <tree string="Animals">
<field name="ref"/>
<field name="name"/>
<field name="gender"/>
<field name="species_id"/>
<field name="breed_id"/>
<field name="color_id"/>
<field name="ref" />
<field name="name" />
<field name="gender" />
<field name="species_id" />
<field name="breed_id" />
<field name="color_id" />
</tree> </tree>
</field> </field>
</record> </record>
@ -22,44 +22,62 @@
<field name="model">animal</field> <field name="model">animal</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Animal"> <form string="Animal">
<header/>
<header />
<sheet> <sheet>
<div class="oe_button_box" name="button_box"> <div class="oe_button_box" name="button_box">
<button name="toggle_active" type="object"
class="oe_stat_button" icon="fa-archive">
<field name="active" widget="boolean_button"
options='{"terminology": "archive"}'/>
<button
name="toggle_active"
type="object"
class="oe_stat_button"
icon="fa-archive"
>
<field
name="active"
widget="boolean_button"
options='{"terminology": "archive"}'
/>
</button> </button>
</div> </div>
<field name="image" widget='image' class="oe_avatar"/>
<field name="image" widget='image' class="oe_avatar" />
<div class="oe_title"> <div class="oe_title">
<h1> <h1>
<field name="name"/>
<field name="name" />
</h1> </h1>
<field name="gender" widget="radio"
options="{'horizontal': true}"/>
<field
name="gender"
widget="radio"
options="{'horizontal': true}"
/>
</div> </div>
<group id="main"> <group id="main">
<group id="left"> <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"/>
<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>
<group id="right"> <group id="right">
<field name="ref"/>
<field name="weight"/>
<field name="birth_date"/>
<field name="ref" />
<field name="weight" />
<field name="birth_date" />
</group> </group>
</group> </group>
<notebook/>
<notebook />
</sheet> </sheet>
<div class="oe_chatter"> <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'}"/>
<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> </div>
</form> </form>
</field> </field>
@ -71,26 +89,46 @@
<field name="model">animal</field> <field name="model">animal</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<kanban class="o_res_partner_kanban"> <kanban class="o_res_partner_kanban">
<field name="id"/>
<field name="image"/>
<field name="name"/>
<field name="id" />
<field name="image" />
<field name="name" />
<templates> <templates>
<t t-name="kanban-box"> <t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban">
<div
class="oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban"
>
<t t-if="record.image.raw_value"> <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"/>
<img
class="o_kanban_image"
t-att-src="kanban_image('animal', 'image', record.id.raw_value)"
t-att-alt="record.name"
/>
</t> </t>
<t t-else=""> <t t-else="">
<img class="o_kanban_image" alt="Avatar" t-att-src='_s + "/animal/static/img/avatar.png"'/>
<img
class="o_kanban_image"
alt="Avatar"
t-att-src='_s + "/animal/static/img/avatar.png"'
/>
</t> </t>
<div class="oe_kanban_details"> <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"/>
<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> <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>
<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> </ul>
<div class="oe_kanban_partner_links"/>
<div class="oe_kanban_partner_links" />
</div> </div>
</div> </div>
</t> </t>
@ -105,36 +143,58 @@
<field name="model">animal</field> <field name="model">animal</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<search string="Animals"> <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/>
<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"> <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'}"/>
<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> </group>
</search> </search>
</field> </field>
@ -145,7 +205,7 @@
<field name="res_model">animal</field> <field name="res_model">animal</field>
<field name="view_type">form</field> <field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field> <field name="view_mode">kanban,tree,form</field>
<field name="search_view_id" ref="view_animal_search"/>
<field name="search_view_id" ref="view_animal_search" />
<field name="help" type="html"> <field name="help" type="html">
<p class="o_view_nocontent_smiling_face"> <p class="o_view_nocontent_smiling_face">
Create an animal. Create an animal.

16
animal/views/animal_breed.xml

@ -6,8 +6,8 @@
<field name="model">animal.breed</field> <field name="model">animal.breed</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Breeds"> <tree string="Breeds">
<field name="name"/>
<field name="species_id"/>
<field name="name" />
<field name="species_id" />
</tree> </tree>
</field> </field>
</record> </record>
@ -18,21 +18,21 @@
<field name="model">animal.breed</field> <field name="model">animal.breed</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Breed"> <form string="Breed">
<header/>
<header />
<sheet> <sheet>
<div class="oe_button_box" name="button_box"/>
<div class="oe_button_box" name="button_box" />
<div class="oe_title"> <div class="oe_title">
<h1> <h1>
<field name="name"/>
<field name="name" />
</h1> </h1>
</div> </div>
<group id="main"> <group id="main">
<group id="left"> <group id="left">
<field name="species_id"/>
<field name="species_id" />
</group> </group>
<group id="right"/>
<group id="right" />
</group> </group>
<notebook/>
<notebook />
</sheet> </sheet>
</form> </form>
</field> </field>

20
animal/views/animal_color.xml

@ -6,9 +6,9 @@
<field name="model">animal.color</field> <field name="model">animal.color</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="colors"> <tree string="colors">
<field name="name"/>
<field name="breed_id"/>
<field name="species_id"/>
<field name="name" />
<field name="breed_id" />
<field name="species_id" />
</tree> </tree>
</field> </field>
</record> </record>
@ -19,22 +19,22 @@
<field name="model">animal.color</field> <field name="model">animal.color</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Color"> <form string="Color">
<header/>
<header />
<sheet> <sheet>
<div class="oe_button_box" name="button_box"/>
<div class="oe_button_box" name="button_box" />
<div class="oe_title"> <div class="oe_title">
<h1> <h1>
<field name="name"/>
<field name="name" />
</h1> </h1>
</div> </div>
<group id="main"> <group id="main">
<group id="left"> <group id="left">
<field name="breed_id"/>
<field name="species_id"/>
<field name="breed_id" />
<field name="species_id" />
</group> </group>
<group id="right"/>
<group id="right" />
</group> </group>
<notebook/>
<notebook />
</sheet> </sheet>
</form> </form>
</field> </field>

14
animal/views/animal_species.xml

@ -6,7 +6,7 @@
<field name="model">animal.species</field> <field name="model">animal.species</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Species"> <tree string="Species">
<field name="name"/>
<field name="name" />
</tree> </tree>
</field> </field>
</record> </record>
@ -17,21 +17,21 @@
<field name="model">animal.species</field> <field name="model">animal.species</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Species"> <form string="Species">
<header/>
<header />
<sheet> <sheet>
<div class="oe_button_box" name="button_box"/>
<div class="oe_button_box" name="button_box" />
<div class="oe_title"> <div class="oe_title">
<h1> <h1>
<field name="name"/>
<field name="name" />
</h1> </h1>
</div> </div>
<group id="main"> <group id="main">
<group id="left"/>
<group id="right"/>
<group id="left" />
<group id="right" />
</group> </group>
<notebook> <notebook>
<page string="Breeds" id="breeds"> <page string="Breeds" id="breeds">
<field name="breed_ids"/>
<field name="breed_ids" />
</page> </page>
</notebook> </notebook>
</sheet> </sheet>

77
animal/views/menu.xml

@ -1,41 +1,50 @@
<odoo> <odoo>
<!-- Main Menu --> <!-- Main Menu -->
<menuitem id="root"
name="Animals"
action="action_animal"
sequence="10"
web_icon="animal,static/description/icon.png"/>
<menuitem id="animal"
name="Animals"
action="action_animal"
sequence="10"
parent="root"/>
<menuitem id="config"
name="Configuration"
sequence="100"
parent="root"
groups="group_animal_manager"/>
<menuitem
id="root"
name="Animals"
action="action_animal"
sequence="10"
web_icon="animal,static/description/icon.png"
/>
<menuitem
id="animal"
name="Animals"
action="action_animal"
sequence="10"
parent="root"
/>
<menuitem
id="config"
name="Configuration"
sequence="100"
parent="root"
groups="group_animal_manager"
/>
<!-- Configuration --> <!-- Configuration -->
<menuitem id="settings"
name="Settings"
sequence="10"
parent="config"/>
<menuitem id="species"
name="Species"
action="action_animal_species"
sequence="20"
parent="config"/>
<menuitem id="breed"
name="Breeds"
action="action_animal_breed"
sequence="30"
parent="config"/>
<menuitem id="color"
name="Colors"
action="action_animal_color"
sequence="40"
parent="config"/>
<menuitem id="settings" name="Settings" sequence="10" parent="config" />
<menuitem
id="species"
name="Species"
action="action_animal_species"
sequence="20"
parent="config"
/>
<menuitem
id="breed"
name="Breeds"
action="action_animal_breed"
sequence="30"
parent="config"
/>
<menuitem
id="color"
name="Colors"
action="action_animal_color"
sequence="40"
parent="config"
/>
</odoo> </odoo>

1
setup/animal/odoo/addons/animal

@ -0,0 +1 @@
../../../../animal

6
setup/animal/setup.py

@ -0,0 +1,6 @@
import setuptools
setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
Loading…
Cancel
Save