first push message

This commit is contained in:
2026-07-01 14:41:49 +07:00
parent 6667dec2bf
commit 58b5f46cc4
2951 changed files with 316619 additions and 0 deletions
+2
View File
@@ -0,0 +1,2 @@
from . import controllers
from . import models
+40
View File
@@ -0,0 +1,40 @@
{
'name': "custom_style_form",
'summary': "Short (1 phrase/line) summary of the module's purpose",
'description': """
Long description of module's purpose
""",
'author': "My Company",
'website': "https://www.yourcompany.com",
# Categories can be used to filter modules in modules listing
# Check https://github.com/odoo/odoo/blob/15.0/odoo/addons/base/data/ir_module_category_data.xml
# for the full list
'category': 'Uncategorized',
'version': '0.1',
# any module necessary for this one to work correctly
'depends': ['web'],
# always loaded
'data': [
# 'security/ir.model.access.csv',
'views/views.xml',
'views/templates.xml',
],
# only loaded in demonstration mode
'demo': [
'demo/demo.xml',
],
'assets': {
'web.assets_backend': [
'custom_style_form/static/src/css/form_custom.css',
'custom_style_form/static/src/css/form_bottons.css',
],
},
'installable': True,
}
@@ -0,0 +1 @@
from . import controllers
@@ -0,0 +1,21 @@
# from odoo import http
# class CustomStyleForm(http.Controller):
# @http.route('/custom_style_form/custom_style_form', auth='public')
# def index(self, **kw):
# return "Hello, world"
# @http.route('/custom_style_form/custom_style_form/objects', auth='public')
# def list(self, **kw):
# return http.request.render('custom_style_form.listing', {
# 'root': '/custom_style_form/custom_style_form',
# 'objects': http.request.env['custom_style_form.custom_style_form'].search([]),
# })
# @http.route('/custom_style_form/custom_style_form/objects/<model("custom_style_form.custom_style_form"):obj>', auth='public')
# def object(self, obj, **kw):
# return http.request.render('custom_style_form.object', {
# 'object': obj
# })
+30
View File
@@ -0,0 +1,30 @@
<odoo>
<data>
<!--
<record id="object0" model="custom_style_form.custom_style_form">
<field name="name">Object 0</field>
<field name="value">0</field>
</record>
<record id="object1" model="custom_style_form.custom_style_form">
<field name="name">Object 1</field>
<field name="value">10</field>
</record>
<record id="object2" model="custom_style_form.custom_style_form">
<field name="name">Object 2</field>
<field name="value">20</field>
</record>
<record id="object3" model="custom_style_form.custom_style_form">
<field name="name">Object 3</field>
<field name="value">30</field>
</record>
<record id="object4" model="custom_style_form.custom_style_form">
<field name="name">Object 4</field>
<field name="value">40</field>
</record>
-->
</data>
</odoo>
+1
View File
@@ -0,0 +1 @@
from . import models
+17
View File
@@ -0,0 +1,17 @@
# from odoo import models, fields, api
# class custom_style_form(models.Model):
# _name = 'custom_style_form.custom_style_form'
# _description = 'custom_style_form.custom_style_form'
# name = fields.Char()
# value = fields.Integer()
# value2 = fields.Float(compute="_value_pc", store=True)
# description = fields.Text()
#
# @api.depends('value')
# def _value_pc(self):
# for record in self:
# record.value2 = float(record.value) / 100
@@ -0,0 +1,2 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_custom_style_form_custom_style_form,custom_style_form.custom_style_form,model_custom_style_form_custom_style_form,base.group_user,1,1,1,1
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_custom_style_form_custom_style_form custom_style_form.custom_style_form model_custom_style_form_custom_style_form base.group_user 1 1 1 1
@@ -0,0 +1,33 @@
/* ==================================================
Odoo 19: Change Save Icon to Text Button
================================================== */
/* 1. Target the Save Button (Cloud Icon) in the Form View Status Bar */
.o_form_view .o_form_button_save {
/* Optional: Adjust padding to make it look like a text button */
padding: 4px 8px !important;
min-width: auto;
}
/* 2. Hide the Cloud/Check Icon inside the button */
/* This targets FontAwesome icons, SVGs, or OWL icons */
/*.o_form_view .o_form_button_save > * {
display: none !important;
}*/
/* 3. Inject the text "Save" */
.o_form_view .o_form_button_save::after {
/* Color: Use 'inherit' to match the 'New' button color (grey/dark)
OR use '#fff' if you want white text on a blue background */
color: #333333;
font-weight: 500;
font-size: 0.9rem;
line-height: 1;
vertical-align: middle;
}
/* Optional: Hover effect to match Odoo's interactive feel */
.o_form_view .o_form_button_save:hover::after {
color: #00A09D; /* Odoo Teal/Primary Color */
cursor: pointer;
}
@@ -0,0 +1,92 @@
/* 1. Form Container */
.o_form_view .o_form_sheet {
border-radius: 5px;
padding: 20px;
box-shadow: none; /* Removes default Odoo shadow for your flat look */
}
/* 2. Labels */
.o_form_view .o_td_label .o_form_label,
.o_form_view .o_field_widget .o_form_label {
display: block !important;
width: 100% !important;
margin-bottom: 6px;
font-weight: 500;
color: #333;
}
/* 3. Inputs & Selects */
.o_form_view .o_field_widget .o_input {
width: 100%;
padding: 5px;
margin: 0px 0;
border: 1px solid #ccc;
border-radius: 4px;
box-sizing: border-box;
background: #fff;
transition: border-color 0.2s, box-shadow 0.2s;
}
.o_form_view .o_field_widget .o_input:focus {
border-color: #4CAF50;
box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
outline: none;
}
/* 4. "Submit" Button (Odoo uses .o_form_button_save) */
/*.o_form_view .o_form_statusbar .o_form_button_save {
width: 100%;
background-color: #4CAF50;
color: white;
padding: 14px;
margin: 8px 0;
border: none;
border-radius: 4px;
cursor: pointer;
font-weight: 500;
transition: background-color 0.2s;
}*/
/* ==================================================
Odoo 19: Freeze Form Tabs (Notebook)
================================================== */
.o_form_view .o_notebook .nav-tabs {
position: -webkit-sticky; /* Safari support */
position: sticky;
top: 0; /* Adjust if status bar is also sticky */
z-index: 90;
background-color: var(--o-view-background-color, #ffffff);
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
padding: 10px 16px 0;
margin-bottom: 0;
}
/* Prevent tab content from overlapping when sticky */
.o_form_view .o_notebook .tab-content {
position: relative;
z-index: 1;
}
/* Freeze Odoo 19 Form Tabs (Notebook) */
.o_form_view .o_notebook .nav-tabs {
position: sticky !important;
top: 48px !important; /* Matches Odoo 19 status bar height */
z-index: 100 !important;
background: #ffffff !important;
border-bottom: 1px solid #e2e8f0;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
padding: 0 16px;
}
/* Critical: Allow sticky to work by removing overflow restrictions */
.o_form_view .o_form_sheet_bg,
.o_form_view .o_notebook,
.o_form_view .o_form_view_container {
overflow: visible !important;
}
/* Optional: Smooth active tab indicator */
.o_form_view .o_notebook .nav-tabs .nav-link.active {
border-bottom: 2px solid #00A09D;
color: #00A09D;
font-weight: 600;
}
+24
View File
@@ -0,0 +1,24 @@
<odoo>
<data>
<!--
<template id="listing">
<ul>
<li t-foreach="objects" t-as="object">
<a t-attf-href="#{ root }/objects/#{ object.id }">
<t t-esc="object.display_name"/>
</a>
</li>
</ul>
</template>
<template id="object">
<h1><t t-esc="object.display_name"/></h1>
<dl>
<t t-foreach="object._fields" t-as="field">
<dt><t t-esc="field"/></dt>
<dd><t t-esc="object[field]"/></dd>
</t>
</dl>
</template>
-->
</data>
</odoo>
+60
View File
@@ -0,0 +1,60 @@
<odoo>
<data>
<!-- explicit list view definition -->
<!--
<record model="ir.ui.view" id="custom_style_form.list">
<field name="name">custom_style_form list</field>
<field name="model">custom_style_form.custom_style_form</field>
<field name="arch" type="xml">
<list>
<field name="name"/>
<field name="value"/>
<field name="value2"/>
</list>
</field>
</record>
-->
<!-- actions opening views on models -->
<!--
<record model="ir.actions.act_window" id="custom_style_form.action_window">
<field name="name">custom_style_form window</field>
<field name="res_model">custom_style_form.custom_style_form</field>
<field name="view_mode">list,form</field>
</record>
-->
<!-- server action to the one above -->
<!--
<record model="ir.actions.server" id="custom_style_form.action_server">
<field name="name">custom_style_form server</field>
<field name="model_id" ref="model_custom_style_form_custom_style_form"/>
<field name="state">code</field>
<field name="code">
action = {
"type": "ir.actions.act_window",
"view_mode": "list,form",
"res_model": model._name,
}
</field>
</record>
-->
<!-- Top menu item -->
<!--
<menuitem name="custom_style_form" id="custom_style_form.menu_root"/>
-->
<!-- menu categories -->
<!--
<menuitem name="Menu 1" id="custom_style_form.menu_1" parent="custom_style_form.menu_root"/>
<menuitem name="Menu 2" id="custom_style_form.menu_2" parent="custom_style_form.menu_root"/>
-->
<!-- actions -->
<!--
<menuitem name="List" id="custom_style_form.menu_1_list" parent="custom_style_form.menu_1"
action="custom_style_form.action_window"/>
<menuitem name="Server to list" id="custom_style_form" parent="custom_style_form.menu_2"
action="custom_style_form.action_server"/>
-->
</data>
</odoo>