weather forecast

This commit is contained in:
XuanHuyen
2025-04-16 10:07:51 +07:00
parent 2fb1ecffc2
commit 1adc5cc52a
13 changed files with 423 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<menuitem
id="menu_weather_root"
name="Dự báo thời tiết"
sequence="10"/>
<menuitem
id="menu_weather_forecast"
name="Dự báo"
action="action_weather_forecast"
parent="menu_weather_root"
sequence="20"/>
</odoo>
@@ -0,0 +1,79 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="weather_api_view_form" model="ir.ui.view">
<field name="name">weather.api.view.form</field>
<field name="model">weather.api</field>
<field name="arch" type="xml">
<form string="">
<header>
<!-- <button name="update_weather" string="Cập nhật thời tiết" type="object"
class="oe_highlight" /> -->
</header>
<sheet>
<group>
<field name="company_id" />
</group>
<!-- các tabs -->
<notebook>
<!-- Thời tiết hiện tại -->
<page string="Hiện tại">
<group>
<group>
<field name="current_temperature" readonly="1" />
<field name="current_humidity" readonly="1" />
</group>
<group>
<field name="current_wind_speed" readonly="1" />
<field name="current_description" readonly="1" />
</group>
</group>
</page>
<!-- Dự báo theo giờ hôm nay -->
<page string="Theo khung giờ">
<separator string="8 tiếng đầu (01h - 08h)" />
<group>
<field name="today_hourly_first" widget="html" readonly="1" />
</group>
<separator string="8 tiếng sau (09h - 16h)" />
<group>
<field name="today_hourly_second" widget="html" readonly="1" />
</group>
<separator string="8 tiếng cuối (17h - 24h)" />
<group>
<field name="today_hourly_third" widget="html" readonly="1" />
</group>
</page>
<!-- Dự báo 3 ngày -->
<page string="3 ngày tới">
<field name="next_3_days_weather" widget="html" readonly="1" />
</page>
</notebook>
</sheet>
</form>
</field>
</record>
<record id="weather_api_view_tree" model="ir.ui.view">
<field name="name">weather.api.view.tree</field>
<field name="model">weather.api</field>
<field name="arch" type="xml">
<list string="">
<field name="company_id" />
</list>
</field>
</record>
<record id="action_weather_forecast" model="ir.actions.act_window">
<field name="name">Dự báo thời tiết</field>
<field name="res_model">weather.api</field>
<field name="view_mode">list,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">Không có dự báo thời tiết trong danh sách này!</p>
</field>
</record>
</odoo>