[ADD] Claude Code ecosystem adapted from Copilot config
Port .github Copilot setup to Claude Code: - CLAUDE.md: condensed project instructions (auto-loaded each session) - .claude/skills: per-language guides (odoo-python, odoo-xml-views, odoo-qweb-html, odoo-javascript) + openspec-* workflow skills - .claude/commands/opsx: /opsx:explore|propose|apply|archive slash commands Original .github/ files kept untouched as extended reference. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
parent
8798f321b3
commit
9a7dfe02db
14 changed files with 1443 additions and 0 deletions
35
.claude/skills/odoo-qweb-html/SKILL.md
Normal file
35
.claude/skills/odoo-qweb-html/SKILL.md
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
---
|
||||
name: odoo-qweb-html
|
||||
description: HTML/CSS/QWeb conventions for this repo (web templates, moving logic to the controller, styling). Use when editing QWeb templates, web views, or CSS in Odoo addons (website_sale_aplicoop).
|
||||
metadata:
|
||||
type: reference
|
||||
---
|
||||
|
||||
# HTML & CSS (Odoo/QWeb)
|
||||
|
||||
## Golden rule
|
||||
**QWeb has strict limitations with complex logic.** Prepare ALL data in the Python controller
|
||||
and use only simple attribute access in the template. This avoids errors like
|
||||
`TypeError: 'NoneType' object is not callable`.
|
||||
|
||||
```python
|
||||
# ❌ BAD — QWeb does not reliably parse this
|
||||
# <t t-set="price" t-value="info.get('price') or product.list_price or 0"/>
|
||||
|
||||
# ✅ GOOD — pre-process in the controller
|
||||
def _prepare_product_display_info(self, product, price_info):
|
||||
price = price_info.get(product.id, {}).get('price') or product.list_price or 0.0
|
||||
return {'display_price': float(price), 'safe_uom': product.uom_id.category_id.name or ''}
|
||||
```
|
||||
```xml
|
||||
<!-- In template: simple access, no conditionals -->
|
||||
<span t-esc="product_display['display_price']"/>
|
||||
```
|
||||
|
||||
## Style and conventions
|
||||
- Valid HTML5. 4-space indentation.
|
||||
- CSS: BEM or utility classes / Bootstrap when available. **No inline styles** except in well-justified cases.
|
||||
- Templates in `views/*.xml` or `static/src/xml/`. Styles in `static/src/css/` (load in manifest if needed).
|
||||
|
||||
## Reference
|
||||
- `docs/QWEB_BEST_PRACTICES.md` for full logic/template separation patterns.
|
||||
Loading…
Add table
Add a link
Reference in a new issue