Theme Create 标志

Theme Create

社区
ahmed-lakosha
theme-create

Odoo 主题脚手架搭建与创建流程。可生成完整、可安装的 Odoo 主题模块,包含规范的文件结构、SCSS 配置、页面模板、镜像模型、theme.utils 激活和自动修复安装。支持 Odoo 14-19。<example> Context: 用户想创建一个新的 Odoo 网站主题 user: "为 Odoo 17 创建一个新的网站主题" assistant: "我会使用 theme-create 技能搭建完整的主题模块。" <commentary>核心触发场景——创建新主题。</commentary> </example> <example> Context: 用户想根据 Figma 搭建主题 user: "根据这个 Figma 设计为 Odoo 17 构建主题" assistant: "我会搭建主题模块,并从 Figma 提取设计令牌。" <commentary>结合 Figma 提取信息创建主题。</commentary> </example> <example> Context: 用户需要为多网站创建镜像模型 user: "为我的网站页面创建主题镜像模型" assistant: "我会生成 theme.ir.ui.view 和 theme.website.page 记录。" <commentary>生成镜像模型。</commentary> </example> <example> Context: 用户想修复无法正常安装的主题 user: "我的主题无法安装,出现未定义变量错误" assistant: "我会诊断 SCSS 加载顺序问题,并修复 map-merge 模式。" <commentary>主题安装调试。</commentary> </example>

Add to TypingMind

概览

发布者ahmed-lakosha
代码仓库odoo-plugins
技能名称theme-create
星标数
74
复刻数
33
附带文件
仅含指令
许可协议MIT
链接
  • Markdown 格式的指令

    模型按需加载 SKILL.md 文件,因此只有在请求确实与该技能匹配时才会消耗 Token。

  • 兼容任何大语言模型

    AI 技能采用纯 Markdown,而非特定提供商的代码,因此可搭配 GPT、Claude、Gemini、Grok 或本地模型使用。

  • 指令自成一体

    模型所需的一切都包含在指令中,无需同步额外文件。

  • 开源

    由 ahmed-lakosha 发布于 GitHub。请在安装前查看技能的源文件。

安装

在 TypingMind 中安装 Theme Create AI 技能,即可搭配任意大语言模型使用;也可以将其放入其他支持读取 SKILL.md 的智能体中。

1

安装到 TypingMind

TypingMind 可直接从 GitHub 文件夹安装技能:读取 SKILL.md,打包资源文件,并将结果保存在本地。

  1. 打开应用,前往“插件 → 技能”。
  2. 选择“从 GitHub 安装”。
  3. 粘贴下方的技能文件夹 URL 并确认。
    https://github.com/ahmed-lakosha/odoo-plugins/tree/master/odoo-frontend-plugin/skills/theme-create
  4. 请在每个需要使用该技能的聊天中启用它。
依次选择“插件 → 技能 → 添加技能 → 从 GitHub URL 导入”,然后粘贴文件夹 URL 并点击“继续”。
2

安装到其他智能体

任何支持 Agent Skills 格式的智能体都可以使用此技能,只需将文件夹复制到该智能体的技能目录中。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ahmed-lakosha/odoo-plugins.git /tmp/odoo-plugins
mkdir -p .claude/skills
cp -r /tmp/odoo-plugins/odoo-frontend-plugin/skills/theme-create .claude/skills/theme-create
复制后,请重启 Claude Code,以加载新技能。

在 TypingMind 中使用此技能

在任意 TypingMind 聊天中启用 Theme Create,后续即可交由模型处理。技能的名称和描述会放在系统提示词中,一旦请求匹配,模型就会自动加载完整指令,无需您手动调用,且在实际使用前不会消耗 Token。

一旦请求与技能匹配,模型就会自动加载 Theme Create。

兼容任何 AI 模型

AI 技能是纯 Markdown 指令,而非特定提供商的代码,因此 Theme Create 不局限于最初适配的模型。只需在 TypingMind 中安装一次,即可搭配 GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 或您自行运行的本地模型使用,全程使用您自己的 API 密钥。

  • 仅在需要时加载

    系统提示词中仅包含技能名称和描述。首次遇到匹配的请求时才会加载完整指令,因此技能未使用时,这些指令不会消耗 Token。

  • 在聊天中切换模型

    技能是指令而非代码,因此切换模型不会导致技能失效,新模型会读取同一个 SKILL.md。

技能指令

这是模型会加载的 SKILL.md 内容。请在安装前阅读,因为技能就是模型将遵循的指令。

Theme Creation Skill

Critical Rules

  1. NEVER modify core Odoo in odoo/ or odoo/addons/
  2. NEVER use map-merge() with core Odoo variables in theme SCSS — they're undefined at load time
  3. NEVER use ir.asset records for Google Fonts — use $o-theme-font-configs
  4. ALWAYS use ('prepend', ...) for primary_variables.scss in asset bundles
  5. H6 is ALWAYS 16px (1rem) — the fixed base reference
  6. All manifests must include author: 'TaqaTechno', website, support, license: 'LGPL-3'

Generated Theme Structure (v8.0)

theme_<name>/
├── __init__.py                      # Imports models
├── __manifest__.py                  # With proper asset bundles
├── models/
│   ├── __init__.py                 # Imports theme_<name>
│   └── theme_<name>.py             # theme.utils implementation (REQUIRED!)
├── security/
│   └── ir.model.access.csv
├── data/
│   ├── assets.xml                  # Minimal (fonts via SCSS, not ir.asset!)
│   ├── menu.xml
│   └── pages/                      # Individual page files (best practice)
│       ├── home_page.xml           # Inherits website.homepage
│       ├── aboutus_page.xml        # theme.website.page
│       ├── contactus_page.xml      # Inherits website.contactus
│       └── services_page.xml       # theme.website.page
├── views/
│   ├── layout/
│   │   └── templates.xml           # Base layout templates
│   └── snippets/
│       └── custom_snippets.xml
└── static/src/
    ├── scss/
    │   ├── primary_variables.scss   # Theme variables + font configs
    │   └── theme.scss               # Additional custom styles
    ├── js/
    │   └── theme.js                 # publicWidget implementations
    └── img/

Manifest Template

python
{
    'name': 'Theme <Name>',
    'version': '<odoo_version>.0.1.0.0',
    'category': 'Theme/Creative',
    'summary': 'Custom theme for <client>',
    'author': 'TaqaTechno',
    'website': 'https://www.taqatechno.com/',
    'support': 'info@taqatechno.com',
    'license': 'LGPL-3',
    'depends': ['website'],
    'data': [
        'security/ir.model.access.csv',
        'views/layout/templates.xml',
        'views/snippets/custom_snippets.xml',
        'data/menu.xml',
        'data/pages/home_page.xml',
        'data/pages/aboutus_page.xml',
        'data/pages/contactus_page.xml',
    ],
    'assets': {
        'web._assets_primary_variables': [
            ('prepend', 'theme_<name>/static/src/scss/primary_variables.scss'),
        ],
        'web.assets_frontend': [
            'theme_<name>/static/src/scss/theme.scss',
            'theme_<name>/static/src/js/theme.js',
        ],
    },
    'installable': True,
    'auto_install': False,
    'application': False,
}

SCSS Load Order (Critical)

1. YOUR theme's primary_variables.scss (via 'prepend')  ← FIRST
2. Odoo core primary_variables.scss                      ← SECOND
3. Other SCSS files

CONSEQUENCE:
  - CANNOT use map-merge() with core variables (they don't exist yet!)
  - MUST define standalone variables
  - Use 'color-palettes-name': 'default-1' to reference existing palettes

WRONG:  $o-color-palettes: map-merge($o-color-palettes, (...));
RIGHT:  $o-website-values-palettes: ( ( 'color-palettes-name': 'default-1' ) );

primary_variables.scss Template

scss
// ===================================================================
// Theme: <Name> — Generated by TaqaTechno
// PREPENDED before Odoo core — DO NOT use map-merge()!
// ===================================================================

// === Font Configuration (STANDALONE) ===
$o-theme-font-configs: (
    'Inter': (
        'family': ('Inter', sans-serif),
        'url': 'Inter:300,300i,400,400i,500,500i,600,600i,700,700i',
    ),
);

// === Website Values Palette (MASTER CONFIGURATION) ===
$o-website-values-palettes: (
    (
        'color-palettes-name': 'default-1',

        // Typography
        'font': 'Inter',
        'headings-font': 'Inter',
        'navbar-font': 'Inter',
        'buttons-font': 'Inter',

        // Header (NO custom header.xml needed!)
        'header-template': 'default',
        'header-links-style': 'default',
        'logo-height': 3rem,
        'fixed-logo-height': 2rem,

        // Buttons
        'btn-padding-y': 0.45rem,
        'btn-padding-x': 1.35rem,
        'btn-border-radius': 0.25rem,

        // Footer (NO custom footer.xml needed!)
        'footer-template': 'default',
        'footer-scrolltop': true,

        // Links & Layout
        'link-underline': 'hover',
        'layout': 'full',
    )
);

// === Typography Multipliers ===
$o-theme-h1-font-size-multiplier: (64 / 16); // 64px
$o-theme-h2-font-size-multiplier: (48 / 16); // 48px
$o-theme-h3-font-size-multiplier: (32 / 16); // 32px
$o-theme-h4-font-size-multiplier: (24 / 16); // 24px
$o-theme-h5-font-size-multiplier: (20 / 16); // 20px
$o-theme-h6-font-size-multiplier: (16 / 16); // 16px (FIXED)

Page Creation Patterns

Homepage (inherits website.homepage)

xml
<template id="view_home" inherit_id="website.homepage" name="Home">
    <xpath expr="//div[@id='wrap']" position="replace">
        <div id="wrap" class="oe_structure">
            <!-- Homepage content -->
        </div>
    </xpath>
</template>

Contact (inherits website.contactus)

xml
<template id="view_contact" inherit_id="website.contactus" name="Contact">
    <xpath expr="//h1" position="replace">
        <h1>Get in Touch</h1>
    </xpath>
</template>

Custom Pages (theme.website.page)

xml
<template id="view_about" name="About">
    <t t-call="website.layout">
        <div id="wrap" class="oe_structure">
            <section class="s_title pt96 pb48">
                <div class="container"><h1>About Us</h1></div>
            </section>
        </div>
    </t>
</template>

<record id="page_about" model="theme.website.page">
    <field name="view_id" ref="view_about"/>
    <field name="is_published" eval="True"/>
    <field name="url">/about</field>
</record>

Theme Mirror Model Architecture

theme.ir.ui.view (Template) → ir.ui.view (Actual, with website_id)
theme.website.page (Template) → website.page (Actual, with website_id)

Each website gets independent copies, enabling theme reuse across multiple sites.

theme.utils Activation (REQUIRED)

Every theme MUST include models/theme_<name>.py:

python
from odoo import models

class Theme<Name>(models.AbstractModel):
    _inherit = 'theme.utils'

    def _theme_<name>_post_copy(self, mod):
        """Called automatically when theme is installed on a website."""
        # Enable header template
        self.enable_view('website.template_header_default')
        # Enable footer template
        self.enable_view('website.template_footer_contact')
        # Show logo, not brand name
        self.enable_view('website.option_header_brand_logo')
        self.disable_view('website.option_header_brand_name')

Method name MUST be _theme_{technical_name}_post_copy where technical_name matches the folder name.

Available methods: enable_view(xml_id), disable_view(xml_id), enable_asset(xml_id), disable_asset(xml_id)

Installation & Testing

bash
# 1. Update module list
python -m odoo -c conf/<PROJECT>.conf -d <DB> --update-list

# 2. Install theme
python -m odoo -c conf/<PROJECT>.conf -d <DB> -i theme_<name> --stop-after-init

# 3. If errors, auto-fix and retry (up to 3 attempts)

Common Auto-Fix Patterns

ErrorFix
Undefined variable "$o-color-palettes"Remove map-merge, use standalone
Undefined variable "$o-theme-font-configs"Define standalone (no map-merge)
SyntaxError in SCSSParse error location, fix syntax
Module not foundAdd dependency to manifest
Malformed Google Fonts @importRemove ir.asset, use $o-theme-font-configs

Testing Checklist

  • Theme installs without errors
  • CSS compilation succeeds
  • No SCSS/JS errors in browser console
  • Header and footer styling apply correctly
  • Responsive layout works on mobile/tablet/desktop
  • Website builder (edit mode) functions without errors

Version-Specific Notes

OdooBootstrapSnippet RegistrationKey Differences
14-154.xSimple XPathml-*/mr-* classes
16-175.1.3Simple XPathms-*/me-* classes
18-195.1.3Groups requiredsnippet-group attribute needed

For the complete 115+ SCSS variable reference, see the theme-scss skill. For Figma-to-Odoo workflow and page template matching, see the theme-design skill.

常见问题

Theme Create AI 技能有什么作用?

Odoo 主题脚手架搭建与创建流程。可生成完整、可安装的 Odoo 主题模块,包含规范的文件结构、SCSS 配置、页面模板、镜像模型、theme.utils 激活和自动修复安装。支持 Odoo 14-19。<example> Context: 用户想创建一个新的 Odoo 网站主题 user: "为 Odoo 17 创建一个新的网站主题" assistant: "我会使用 theme-create 技能搭建完整的主题模块。" <commentary>核心触发场景——创建新主题。</commentary> </example> <example> Context: 用户想根据 Figma 搭建主题 user: "根据这个 Figma 设计为 Odoo 17 构建主题" assistant: "我会搭建主题模块,并从 Figma 提取设计令牌。" <commentary>结合 Figma 提取信息创建主题。</commentary> </example> <example> Context: 用户需要为多网站创建镜像模型 user: "为我的网站页面创建主题镜像模型" assistant: "我会生成 theme.ir.ui.view 和 theme.website.page 记录。" <commentary>生成镜像模型。</commentary> </example> <ex...

为什么在 TypingMind 中使用 Theme Create?

因为您只需安装一次,就能搭配任何模型使用。Theme Create 采用纯 Markdown 格式,而非特定提供商专用的代码,因此同一技能可用于 GPT-5、Claude、Gemini、Grok 或本地模型。您甚至可以在聊天中途切换模型,而不会影响技能的正常使用。TypingMind 使用您自己的 API 密钥,因此您直接向提供商付费,而不是按席位订阅;您的技能和聊天记录也都保留在您自己的存储空间中。

如何在 TypingMind 中安装 Theme Create?

在 TypingMind 中打开“插件 → 技能 → 从 GitHub 安装”,然后粘贴 https://github.com/ahmed-lakosha/odoo-plugins/tree/master/odoo-frontend-plugin/skills/theme-create。TypingMind 会读取其中的 SKILL.md,并将其安装为技能,供您在各个聊天中按需启用。

哪些 AI 模型可以使用 Theme Create?

您在 TypingMind 中连接的任何模型都可以。AI 技能采用纯 Markdown 指令,而非特定提供商专用的代码,因此 GPT、Claude、Gemini、Grok 和本地模型都能在请求匹配时加载此技能。

Theme Create 可以搭配多少个 AI 模型使用?

数量不限。只要模型支持技能,您就可以将它与 Theme Create 搭配使用。GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llama 等模型都可以通过您自己的 API 密钥接入 TypingMind。

Theme Create AI 技能免费吗?

是的。ahmed-lakosha 已在 GitHub 上根据 MIT 许可证发布了该技能。您只需向自己的 AI 提供商支付所用 Token 的费用。

什么是 AI 技能?

AI 技能是一组可复用的指令,用于教会 AI 模型完成某项特定任务。它遵循开放的 Agent Skills 格式:包含名称和描述的 SKILL.md 文件,以及模型可能需要的脚本、模板或参考文件。模型仅在您的请求与技能匹配时才会读取这些指令,因此已安装的技能在使用前不会产生任何费用。

AI 技能与插件或 MCP 服务器有何不同?

插件或 MCP 服务器为模型提供可调用的新工具,也就是在某处运行并返回结果的代码。AI 技能则为模型提供知识和流程:如何处理任务、遵循哪些步骤,以及怎样的输出才算优质。技能采用纯 Markdown 格式,因此不需要服务器、API 密钥或运行时环境,并且适用于任何模型。

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇