This commit is contained in:
mtpc4s9 2025-11-19 00:00:02 +07:00
parent c12a1742d0
commit d95f80636b
5 changed files with 47 additions and 0 deletions

1
addons/zoo/__init__.py Normal file
View File

@ -0,0 +1 @@
from . import models

View File

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# https://www.odoo.com/documentation/18.0/developer/reference/backend/module.html
{
'name': 'Zoo City',
'summary': """Zoo City Tutorials""",
'description': """Building my own zoo city""",
'author': 'minhng.info',
'maintainer': 'minhng.info',
'website': 'https://minhng.info',
'category': 'Uncategorized', # https://github.com/odoo/odoo/blob/18.0/odoo/addons/base/data/ir_module_category_data.xml
'version': '0.1',
'depends': [
'product',
],
'data': [],
'demo': [],
'css': [],
# 'qweb': ['static/src/xml/*.xml'],
'installable': True,
'auto_install': False,
'application': True,
}

View File

@ -0,0 +1 @@
from . import zoo_animal

View File

@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
from odoo import api, fields, models, tools, _
from odoo.exceptions import UserError, ValidationError
import datetime
class ZooAnimal(models.Model):
_name = "zoo.animal"
_description = "Animal in the zoo"
name = fields.Char('Animal Name', required=True)
description = fields.Text('Description')
dob = fields.Date('DOB', required=False)
gender = fields.Selection([
('male', 'Male'),
('female', 'Female')
], string='Gender', default='male', required=True)
feed_time = fields.Datetime('Feed Time', copy=False)
is_alive = fields.Boolean('Is Alive', default=True)
image = fields.Binary("Image", attachment=True, help="Animal Image")
weight = fields.Float('Weight (kg)')
weight_pound = fields.Float('Weight (pounds)')
introduction = fields.Text('Introduction (EN)')

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB