FIX: pos: wenn auf - gedrückt wird um eine Order zu entfernen, wurde nicht
die Order nicht gefunden. -> behoben - IMP: "einfachere" Debug Möglichkeit mit odoo-18-dev container. README.md in .vscode hinzugefügt.
This commit is contained in:
parent
d56ae65b56
commit
dff2de1755
15
.devcontainer/devcontainer.json
Normal file
15
.devcontainer/devcontainer.json
Normal file
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"name": "Open Workshop (Odoo Dev)",
|
||||||
|
"dockerComposeFile": ["${localWorkspaceFolder}/../../odoo/docker-compose.dev.yaml"],
|
||||||
|
"service": "odoo-dev",
|
||||||
|
"workspaceFolder": "/mnt/extra-addons/open_workshop",
|
||||||
|
"runServices": ["odoo-dev", "db"],
|
||||||
|
"shutdownAction": "stopCompose",
|
||||||
|
"remoteUser": "root",
|
||||||
|
"extensions": [
|
||||||
|
"ms-python.python",
|
||||||
|
"ms-python.vscode-pylance"
|
||||||
|
],
|
||||||
|
"forwardPorts": [4338],
|
||||||
|
"postStartCommand": "echo 'Devcontainer started'"
|
||||||
|
}
|
||||||
64
.vscode/README.md
vendored
Normal file
64
.vscode/README.md
vendored
Normal file
|
|
@ -0,0 +1,64 @@
|
||||||
|
# Quickstart: Debugging für open_workshop
|
||||||
|
|
||||||
|
Diese Datei hilft dir, das `open_workshop` Addon schnell in VS Code zu öffnen und sowohl das Addon als auch (optional) den Odoo‑Core zu debuggen.
|
||||||
|
|
||||||
|
Kurzfassung
|
||||||
|
- Öffne in VS Code den Ordner `extra-addons/open_workshop`.
|
||||||
|
- Starte die Development-Container/Composer Umgebung mit `./dev.sh` (Option 1 oder 2).
|
||||||
|
- Verwende die DevContainer‑Funktion oder die Debug‑Konfigurationen unten.
|
||||||
|
|
||||||
|
1) Container starten
|
||||||
|
|
||||||
|
Empfohlen: im Projektstamm (`odoo`) ausführen:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./dev.sh
|
||||||
|
# Option 1: Normal starten (ODOO_DEV=1)
|
||||||
|
# Option 2: Debug-Modus (ODOO_DEBUG=1) — der Container wartet auf eine Debug-Verbindung
|
||||||
|
```
|
||||||
|
|
||||||
|
2) VS Code als DevContainer verbinden (empfohlen)
|
||||||
|
|
||||||
|
- Öffne VS Code im lokalen Ordner `extra-addons/open_workshop`.
|
||||||
|
- Command Palette → `Dev Containers: Attach to Running Container...` → wähle `odoo-dev`.
|
||||||
|
- VS Code öffnet den Container als Arbeitsumgebung (remoteUser ist `odoo`).
|
||||||
|
- Öffne dann das Workspace‑Verzeichnis `/mnt/extra-addons/open_workshop`.
|
||||||
|
|
||||||
|
Vorteil: Du arbeitest direkt im Container (kein lokales Kopieren der Core‑Sourcen nötig) und Breakpoints funktionieren zuverlässig.
|
||||||
|
|
||||||
|
3) Debugging (Attach)
|
||||||
|
|
||||||
|
- Wenn du als DevContainer verbunden bist, verwende die Debug‑Konfiguration "Odoo Attach (container)" (port 5678).
|
||||||
|
- Wenn du lokal arbeitest und den Host‑Port benutzt, verwende "Odoo Attach (host)" (port 4338).
|
||||||
|
|
||||||
|
4) Pfad‑Mapping
|
||||||
|
|
||||||
|
- Die `launch.json` enthält Pfadabbildungen:
|
||||||
|
- `${workspaceFolder}` ↔ `/mnt/extra-addons/open_workshop` (dein Addon)
|
||||||
|
- `${workspaceFolder}/../../odoo-source/odoo` ↔ `/usr/lib/python3/dist-packages/odoo` (falls du lokal eine Kopie des Odoo‑Cores hast)
|
||||||
|
|
||||||
|
Hinweis: Lokale `odoo-source` ist nicht erforderlich, wenn du per DevContainer arbeitest, weil VS Code die Dateien direkt im Container liest.
|
||||||
|
|
||||||
|
5) Troubleshooting
|
||||||
|
|
||||||
|
- Debug-Verbindung schlägt fehl: prüfe, ob der Container im Debug‑Modus läuft und der Port gemappt ist:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker compose -f docker-compose.dev.yaml ps
|
||||||
|
docker compose -f docker-compose.dev.yaml logs -f odoo-dev
|
||||||
|
```
|
||||||
|
|
||||||
|
- VS Code meldet, dass Breakpoints nicht aufgelöst werden: vergewissere dich, dass die `pathMappings` korrekt sind und die lokalen Dateien existieren (oder nutze DevContainer).
|
||||||
|
|
||||||
|
6) Image/Compose aktualisieren
|
||||||
|
|
||||||
|
- Wenn du `Dockerfile.Dev` geändert hast: neu bauen (Option 3 in `./dev.sh`), dann Container neu starten (Option 5 oder down/up).
|
||||||
|
|
||||||
|
7) Kurze Checklist für Mitentwickler
|
||||||
|
|
||||||
|
- `./dev.sh` → Option 3 (einmalig) wenn du das Dev‑Image bauen musst.
|
||||||
|
- `./dev.sh` → Option 1 oder 2 zum Starten.
|
||||||
|
- In VS Code: Öffne `extra-addons/open_workshop`, dann `Dev Containers: Attach to Running Container...`.
|
||||||
|
- Starte Debug mit "Odoo Attach (container)" oder "Odoo Attach (host)".
|
||||||
|
|
||||||
|
|
||||||
26
.vscode/launch.json
vendored
26
.vscode/launch.json
vendored
|
|
@ -2,7 +2,7 @@
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": [
|
||||||
{
|
{
|
||||||
"name": "Odoo Debug (Remote)",
|
"name": "Odoo Attach (host)",
|
||||||
"type": "debugpy",
|
"type": "debugpy",
|
||||||
"request": "attach",
|
"request": "attach",
|
||||||
"connect": {
|
"connect": {
|
||||||
|
|
@ -12,10 +12,30 @@
|
||||||
"pathMappings": [
|
"pathMappings": [
|
||||||
{
|
{
|
||||||
"localRoot": "${workspaceFolder}",
|
"localRoot": "${workspaceFolder}",
|
||||||
"remoteRoot": "/opt/odoo/workspace/open_workshop"
|
"remoteRoot": "/mnt/extra-addons/open_workshop"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"localRoot": "${workspaceFolder}/../odoo-source/odoo",
|
"localRoot": "${workspaceFolder}/../../odoo-source/odoo",
|
||||||
|
"remoteRoot": "/usr/lib/python3/dist-packages/odoo"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"justMyCode": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Odoo Attach (container)",
|
||||||
|
"type": "debugpy",
|
||||||
|
"request": "attach",
|
||||||
|
"connect": {
|
||||||
|
"host": "localhost",
|
||||||
|
"port": 5678
|
||||||
|
},
|
||||||
|
"pathMappings": [
|
||||||
|
{
|
||||||
|
"localRoot": "${workspaceFolder}",
|
||||||
|
"remoteRoot": "/mnt/extra-addons/open_workshop"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"localRoot": "${workspaceFolder}/../../odoo-source/odoo",
|
||||||
"remoteRoot": "/usr/lib/python3/dist-packages/odoo"
|
"remoteRoot": "/usr/lib/python3/dist-packages/odoo"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
12
.vscode/settings.json
vendored
12
.vscode/settings.json
vendored
|
|
@ -1,8 +1,16 @@
|
||||||
|
{
|
||||||
|
"python.pythonPath": "/usr/bin/python3",
|
||||||
|
"python.analysis.extraPaths": [
|
||||||
|
"${workspaceFolder}",
|
||||||
|
"${workspaceFolder}/../../odoo-source/odoo"
|
||||||
|
],
|
||||||
|
"python.analysis.typeCheckingMode": "off"
|
||||||
|
}
|
||||||
{
|
{
|
||||||
"editor.rulers": [80, 100, 120],
|
"editor.rulers": [80, 100, 120],
|
||||||
"files.eol": "\n",
|
"files.eol": "\n",
|
||||||
"[python]": {
|
"[python]": {
|
||||||
"editor.defaultFormatter": "charliermarsh.ruff",
|
"editor.defaultFormatter": "ms-python.python",
|
||||||
"editor.insertSpaces": true,
|
"editor.insertSpaces": true,
|
||||||
"editor.tabSize": 4
|
"editor.tabSize": 4
|
||||||
},
|
},
|
||||||
|
|
@ -11,7 +19,7 @@
|
||||||
"editor.tabSize": 2
|
"editor.tabSize": 2
|
||||||
},
|
},
|
||||||
"python.analysis.extraPaths": [
|
"python.analysis.extraPaths": [
|
||||||
"../odoo-source/odoo",
|
"../../odoo-source/odoo",
|
||||||
],
|
],
|
||||||
"python.testing.pytestArgs": [
|
"python.testing.pytestArgs": [
|
||||||
"--odoo-http",
|
"--odoo-http",
|
||||||
|
|
|
||||||
83
.vscode/tasks.json
vendored
83
.vscode/tasks.json
vendored
|
|
@ -4,71 +4,64 @@
|
||||||
{
|
{
|
||||||
"label": "start-odoo-dev",
|
"label": "start-odoo-dev",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "docker-compose",
|
"command": "docker",
|
||||||
"args": ["-f", "docker-compose.dev.yaml", "up", "-d"],
|
"args": ["compose", "-f", "${workspaceFolder}/../../odoo/docker-compose.dev.yaml", "up", "-d"],
|
||||||
"group": "build",
|
"options": {
|
||||||
"presentation": {
|
"env": {
|
||||||
"echo": true,
|
"ODOO_DEV": "1"
|
||||||
"reveal": "always",
|
}
|
||||||
"focus": false,
|
|
||||||
"panel": "shared"
|
|
||||||
},
|
},
|
||||||
|
"group": { "kind": "build", "isDefault": true },
|
||||||
|
"presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared" },
|
||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "start-odoo-debug",
|
"label": "start-odoo-debug",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "docker-compose",
|
"command": "docker",
|
||||||
"args": ["-f", "docker-compose.dev.yaml", "exec", "-e", "ODOO_DEBUG=1", "odoo-dev", "odoo"],
|
"args": ["compose", "-f", "${workspaceFolder}/../../odoo/docker-compose.dev.yaml", "up", "-d"],
|
||||||
"group": "build",
|
"options": {
|
||||||
"presentation": {
|
"env": {
|
||||||
"echo": true,
|
"ODOO_DEBUG": "1"
|
||||||
"reveal": "always",
|
}
|
||||||
"focus": false,
|
|
||||||
"panel": "shared"
|
|
||||||
},
|
},
|
||||||
"problemMatcher": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"label": "stop-odoo-dev",
|
|
||||||
"type": "shell",
|
|
||||||
"command": "docker-compose",
|
|
||||||
"args": ["-f", "docker-compose.dev.yaml", "down"],
|
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"presentation": {
|
"presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared" },
|
||||||
"echo": true,
|
|
||||||
"reveal": "always",
|
|
||||||
"focus": false,
|
|
||||||
"panel": "shared"
|
|
||||||
},
|
|
||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "rebuild-odoo-dev",
|
"label": "rebuild-odoo-dev",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "docker-compose",
|
"command": "docker",
|
||||||
"args": ["-f", "docker-compose.dev.yaml", "up", "--build", "-d"],
|
"args": ["compose", "-f", "${workspaceFolder}/../../odoo/docker-compose.dev.yaml", "up", "--build", "-d"],
|
||||||
"group": "build",
|
"group": "build",
|
||||||
"presentation": {
|
"presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared" },
|
||||||
"echo": true,
|
"problemMatcher": []
|
||||||
"reveal": "always",
|
},
|
||||||
"focus": false,
|
{
|
||||||
"panel": "shared"
|
"label": "stop-odoo-dev",
|
||||||
},
|
"type": "shell",
|
||||||
|
"command": "docker",
|
||||||
|
"args": ["compose", "-f", "${workspaceFolder}/../..odoo/docker-compose.dev.yaml", "down"],
|
||||||
|
"group": "build",
|
||||||
|
"presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared" },
|
||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label": "odoo-logs",
|
"label": "odoo-logs",
|
||||||
"type": "shell",
|
"type": "shell",
|
||||||
"command": "docker-compose",
|
"command": "docker",
|
||||||
"args": ["-f", "docker-compose.dev.yaml", "logs", "-f", "odoo-dev"],
|
"args": ["compose", "-f", "${workspaceFolder}/../../odoo/docker-compose.dev.yaml", "logs", "-f", "odoo-dev"],
|
||||||
"group": "test",
|
"group": "test",
|
||||||
"presentation": {
|
"presentation": { "echo": true, "reveal": "always", "focus": false, "panel": "shared" },
|
||||||
"echo": true,
|
"problemMatcher": []
|
||||||
"reveal": "always",
|
},
|
||||||
"focus": false,
|
{
|
||||||
"panel": "shared"
|
"label": "shell-odoo",
|
||||||
},
|
"type": "shell",
|
||||||
|
"command": "docker",
|
||||||
|
"args": ["compose", "-f", "${workspaceFolder}/../../odoo/docker-compose.dev.yaml", "exec", "odoo-dev", "bash"],
|
||||||
|
"presentation": { "echo": true, "reveal": "always", "focus": true, "panel": "shared" },
|
||||||
"problemMatcher": []
|
"problemMatcher": []
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
|
||||||
11
open_workshop.code-workspace
Normal file
11
open_workshop.code-workspace
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{
|
||||||
|
"folders": [
|
||||||
|
{
|
||||||
|
"path": "."
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"path": "../../../usr/lib/python3/dist-packages/odoo"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"settings": {}
|
||||||
|
}
|
||||||
|
|
@ -22,7 +22,7 @@ export class OwsPosCustomerSidebar extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
async removeCurrentOrder() {
|
async removeCurrentOrder() {
|
||||||
this.pos.onDeleteOrder(order)
|
this.pos.onDeleteOrder(this.pos.get_order())
|
||||||
}
|
}
|
||||||
|
|
||||||
openTicketScreen() {
|
openTicketScreen() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user