ok
This commit is contained in:
parent
c12a1742d0
commit
d95f80636b
1
addons/zoo/__init__.py
Normal file
1
addons/zoo/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from . import models
|
||||
22
addons/zoo/__manifest__.py
Normal file
22
addons/zoo/__manifest__.py
Normal 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,
|
||||
}
|
||||
1
addons/zoo/models/__init__.py
Normal file
1
addons/zoo/models/__init__.py
Normal file
@ -0,0 +1 @@
|
||||
from . import zoo_animal
|
||||
23
addons/zoo/models/zoo_animal.py
Normal file
23
addons/zoo/models/zoo_animal.py
Normal 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)')
|
||||
BIN
addons/zoo/static/description/icon.png
Normal file
BIN
addons/zoo/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
Loading…
Reference in New Issue
Block a user