Deploy AIOS web (React glide grid + FastAPI slice)
Browse files- RELEASES.json +1 -1
- VERSION +1 -1
- api/odoo_relational.py +9 -0
- api/routes_forms.py +27 -0
- api/routes_sheet.py +15 -0
- web/public/AIOS_DEPLOY_RECEIPT +1 -1
- web/src/index.css +3 -0
- web/src/settings/SettingsModal.tsx +3 -2
- web/src/sheet/PivotTab.tsx +4 -1
RELEASES.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
{
|
| 2 |
-
"current": "
|
| 3 |
"releases": []
|
| 4 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"current": "3d13934b",
|
| 3 |
"releases": []
|
| 4 |
}
|
VERSION
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
3d13934b
|
api/odoo_relational.py
CHANGED
|
@@ -3407,6 +3407,10 @@ def stock_source_specs():
|
|
| 3407 |
**_stock_location_cols("source_location", "sl", "sm.location_id"),
|
| 3408 |
**_stock_location_cols("destination_location", "sd", "sm.location_dest_id"),
|
| 3409 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3410 |
valuation_cols = {
|
| 3411 |
"odoo_id": ("svl.id", _stock_id), **_stock_product_cols("svl"),
|
| 3412 |
"qty": ("svl.quantity", _stock_number), "value": ("svl.value", _stock_number),
|
|
@@ -3421,6 +3425,8 @@ def stock_source_specs():
|
|
| 3421 |
"tables": {"sm": "stock_move", "pp": "product_product", "sl": "stock_location",
|
| 3422 |
"sd": "stock_location"},
|
| 3423 |
"where": "", "id": "sm.id", "cols": move_cols,
|
|
|
|
|
|
|
| 3424 |
},
|
| 3425 |
STOCK_VALUATION_KEY: {
|
| 3426 |
"from_sql": "(stock_valuation_layer svl LEFT JOIN product_product pp "
|
|
@@ -3429,6 +3435,8 @@ def stock_source_specs():
|
|
| 3429 |
"tables": {"svl": "stock_valuation_layer", "pp": "product_product", "sm": "stock_move",
|
| 3430 |
"sl": "stock_location", "sd": "stock_location"},
|
| 3431 |
"where": "", "id": "svl.id", "cols": valuation_cols,
|
|
|
|
|
|
|
| 3432 |
},
|
| 3433 |
STOCK_QUANT_KEY: {
|
| 3434 |
"from_sql": "(stock_quant sq LEFT JOIN product_product pp ON pp.id = sq.product_id "
|
|
@@ -3439,6 +3447,7 @@ def stock_source_specs():
|
|
| 3439 |
**_stock_location_cols("location", "sl", "sq.location_id"),
|
| 3440 |
"qty": ("sq.quantity", _stock_number),
|
| 3441 |
"reserved_qty": ("sq.reserved_quantity", _stock_number)},
|
|
|
|
| 3442 |
},
|
| 3443 |
}
|
| 3444 |
|
|
|
|
| 3407 |
**_stock_location_cols("source_location", "sl", "sm.location_id"),
|
| 3408 |
**_stock_location_cols("destination_location", "sd", "sm.location_dest_id"),
|
| 3409 |
}
|
| 3410 |
+
# A mirror whose stock_location predates the parent_path backfill serves a blank FBA flag; the
|
| 3411 |
+
# EXISTS over an absent column is a DuckDB Binder error, which reached Data as a bare 500.
|
| 3412 |
+
no_ancestry = {"absent": (("stock_location", "parent_path"),)}
|
| 3413 |
+
blank_fba = ("''", _stock_flag)
|
| 3414 |
valuation_cols = {
|
| 3415 |
"odoo_id": ("svl.id", _stock_id), **_stock_product_cols("svl"),
|
| 3416 |
"qty": ("svl.quantity", _stock_number), "value": ("svl.value", _stock_number),
|
|
|
|
| 3425 |
"tables": {"sm": "stock_move", "pp": "product_product", "sl": "stock_location",
|
| 3426 |
"sd": "stock_location"},
|
| 3427 |
"where": "", "id": "sm.id", "cols": move_cols,
|
| 3428 |
+
"optional": ({**no_ancestry, "without": {"cols": {
|
| 3429 |
+
"source_location_fba": blank_fba, "destination_location_fba": blank_fba}}},),
|
| 3430 |
},
|
| 3431 |
STOCK_VALUATION_KEY: {
|
| 3432 |
"from_sql": "(stock_valuation_layer svl LEFT JOIN product_product pp "
|
|
|
|
| 3435 |
"tables": {"svl": "stock_valuation_layer", "pp": "product_product", "sm": "stock_move",
|
| 3436 |
"sl": "stock_location", "sd": "stock_location"},
|
| 3437 |
"where": "", "id": "svl.id", "cols": valuation_cols,
|
| 3438 |
+
"optional": ({**no_ancestry, "without": {"cols": {
|
| 3439 |
+
"source_location_fba": blank_fba, "destination_location_fba": blank_fba}}},),
|
| 3440 |
},
|
| 3441 |
STOCK_QUANT_KEY: {
|
| 3442 |
"from_sql": "(stock_quant sq LEFT JOIN product_product pp ON pp.id = sq.product_id "
|
|
|
|
| 3447 |
**_stock_location_cols("location", "sl", "sq.location_id"),
|
| 3448 |
"qty": ("sq.quantity", _stock_number),
|
| 3449 |
"reserved_qty": ("sq.reserved_quantity", _stock_number)},
|
| 3450 |
+
"optional": ({**no_ancestry, "without": {"cols": {"location_fba": blank_fba}}},),
|
| 3451 |
},
|
| 3452 |
}
|
| 3453 |
|
api/routes_forms.py
CHANGED
|
@@ -500,14 +500,41 @@ def mint_setup_link(body: dict, session: Session = Depends(require_session)):
|
|
| 500 |
raise err(503, "setup_unavailable", "Unavailable") from None
|
| 501 |
|
| 502 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 503 |
def _write_setup_credentials(rt, record, fields):
|
| 504 |
"""Keep API-owned scoping and reconnect effects out of the lower core module."""
|
| 505 |
from core import keychain
|
| 506 |
import routes_keychain as keys
|
| 507 |
|
| 508 |
current = _setup_owner(rt, record["tenant"], record["owner"], record["scope"])
|
|
|
|
|
|
|
| 509 |
keychain.add_entry(rt, None, record["connector"], fields, current.uname,
|
| 510 |
scope=record["scope"], write_scope=keys._write_scope)
|
|
|
|
|
|
|
|
|
|
| 511 |
if record["connector"] == "odoo":
|
| 512 |
try:
|
| 513 |
keys._rel_reconnect(rt)
|
|
|
|
| 500 |
raise err(503, "setup_unavailable", "Unavailable") from None
|
| 501 |
|
| 502 |
|
| 503 |
+
def _starter_selection(rt, provider):
|
| 504 |
+
"""S70-T10 through the S70-T11 door: a first connection syncs the starter set, never everything.
|
| 505 |
+
|
| 506 |
+
The link form has no database step, so it takes the wizard's preselected rows. An existing
|
| 507 |
+
connection or an earlier choice document is left alone (Settings owns a change)."""
|
| 508 |
+
from connector_onboarding import choices, install_selection
|
| 509 |
+
from core import keychain
|
| 510 |
+
import routes_keychain as keys
|
| 511 |
+
|
| 512 |
+
starter = [row["key"] for row in choices(provider) if row.get("selected")]
|
| 513 |
+
if not starter:
|
| 514 |
+
return False
|
| 515 |
+
if any(entry.get("type") == provider for entry in keychain.list_entries(rt)) \
|
| 516 |
+
or (provider == "odoo" and keys.env_odoo_available(rt)):
|
| 517 |
+
return False
|
| 518 |
+
try:
|
| 519 |
+
install_selection(rt, provider, starter, existing=False)
|
| 520 |
+
except ValueError:
|
| 521 |
+
return False
|
| 522 |
+
return True
|
| 523 |
+
|
| 524 |
+
|
| 525 |
def _write_setup_credentials(rt, record, fields):
|
| 526 |
"""Keep API-owned scoping and reconnect effects out of the lower core module."""
|
| 527 |
from core import keychain
|
| 528 |
import routes_keychain as keys
|
| 529 |
|
| 530 |
current = _setup_owner(rt, record["tenant"], record["owner"], record["scope"])
|
| 531 |
+
# Before the credential, as the wizard does, so no runner sees a key with all-on defaults.
|
| 532 |
+
selected = _starter_selection(rt, record["connector"])
|
| 533 |
keychain.add_entry(rt, None, record["connector"], fields, current.uname,
|
| 534 |
scope=record["scope"], write_scope=keys._write_scope)
|
| 535 |
+
if selected:
|
| 536 |
+
from connector_onboarding import seal_selection
|
| 537 |
+
seal_selection(rt, record["connector"])
|
| 538 |
if record["connector"] == "odoo":
|
| 539 |
try:
|
| 540 |
keys._rel_reconnect(rt)
|
api/routes_sheet.py
CHANGED
|
@@ -562,6 +562,14 @@ def _pivot_fields(pivot):
|
|
| 562 |
| sheet_mod.filter_columns_named(pivot.get("filters", [])))
|
| 563 |
|
| 564 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 565 |
def _check_pivot_fields(session, pivot, spec, columns, *, filter_fields=None):
|
| 566 |
"""Reject every unreadable axis, value or filter, including COUNT's named field."""
|
| 567 |
from core import perm_scope
|
|
@@ -572,7 +580,14 @@ def _check_pivot_fields(session, pivot, spec, columns, *, filter_fields=None):
|
|
| 572 |
named.update(sheet_mod.filter_columns_named(pivot.get("filters", []))
|
| 573 |
if filter_fields is None else filter_fields)
|
| 574 |
hidden = perm_scope.hidden_keys(session.user, pivot["database"], fields, st=session.runtime)
|
|
|
|
| 575 |
for field in sorted(named):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 576 |
if field in hidden or field not in columns or not columns[field].get("sql"):
|
| 577 |
raise err(403, "field_unreadable",
|
| 578 |
f"You cannot read field {field} in {pivot['database']}.")
|
|
|
|
| 562 |
| sheet_mod.filter_columns_named(pivot.get("filters", [])))
|
| 563 |
|
| 564 |
|
| 565 |
+
def _pivot_unsupported():
|
| 566 |
+
"""Fields the workspace schema offers that no mirror column backs, keyed to their label.
|
| 567 |
+
|
| 568 |
+
Today that is the routing Zone overlay `user_tables.with_zone_field` appends."""
|
| 569 |
+
from core import user_tables
|
| 570 |
+
return {user_tables.ZONE_FIELD_KEY: "Zone"}
|
| 571 |
+
|
| 572 |
+
|
| 573 |
def _check_pivot_fields(session, pivot, spec, columns, *, filter_fields=None):
|
| 574 |
"""Reject every unreadable axis, value or filter, including COUNT's named field."""
|
| 575 |
from core import perm_scope
|
|
|
|
| 580 |
named.update(sheet_mod.filter_columns_named(pivot.get("filters", []))
|
| 581 |
if filter_fields is None else filter_fields)
|
| 582 |
hidden = perm_scope.hidden_keys(session.user, pivot["database"], fields, st=session.runtime)
|
| 583 |
+
unsupported = _pivot_unsupported()
|
| 584 |
for field in sorted(named):
|
| 585 |
+
if field not in hidden and field in unsupported \
|
| 586 |
+
and (field not in columns or not columns[field].get("sql")):
|
| 587 |
+
# Readable but derived outside the mirror: a named limit, never a permission refusal,
|
| 588 |
+
# which the pivot client reads as lost access and clears every offered field.
|
| 589 |
+
raise err(409, "pivot_field_unsupported",
|
| 590 |
+
f"{unsupported[field]} cannot be used in a pivot yet. Choose another field.")
|
| 591 |
if field in hidden or field not in columns or not columns[field].get("sql"):
|
| 592 |
raise err(403, "field_unreadable",
|
| 593 |
f"You cannot read field {field} in {pivot['database']}.")
|
web/public/AIOS_DEPLOY_RECEIPT
CHANGED
|
@@ -1 +1 @@
|
|
| 1 |
-
|
|
|
|
| 1 |
+
d6c17411cbadfa6cd1db731e1fdfc75fcccaa86139fcfedb32db9aec98c46ae3
|
web/src/index.css
CHANGED
|
@@ -6997,6 +6997,9 @@ a.cg-map-ctl-b { text-decoration: none; }
|
|
| 6997 |
font-size: var(--lp-fs-md);
|
| 6998 |
line-height: 1;
|
| 6999 |
cursor: pointer;
|
|
|
|
|
|
|
|
|
|
| 7000 |
}
|
| 7001 |
.set-close:hover { background: var(--lp-surface-2); color: var(--lp-ink); }
|
| 7002 |
.set-close:focus-visible { outline: 2px solid var(--lp-blue-deep); outline-offset: 1px; }
|
|
|
|
| 6997 |
font-size: var(--lp-fs-md);
|
| 6998 |
line-height: 1;
|
| 6999 |
cursor: pointer;
|
| 7000 |
+
/* Above the positioned panes in `.set-body` (`.set-perms` is `position: relative` and comes
|
| 7001 |
+
later), or the close control is visible and every click lands on the pane. */
|
| 7002 |
+
z-index: 2;
|
| 7003 |
}
|
| 7004 |
.set-close:hover { background: var(--lp-surface-2); color: var(--lp-ink); }
|
| 7005 |
.set-close:focus-visible { outline: 2px solid var(--lp-blue-deep); outline-offset: 1px; }
|
web/src/settings/SettingsModal.tsx
CHANGED
|
@@ -543,7 +543,8 @@ function AddUser({
|
|
| 543 |
onClick={() => {
|
| 544 |
setBusy(true);
|
| 545 |
void createUser({
|
| 546 |
-
|
|
|
|
| 547 |
// ⭐ WAVE 37 · T04 (R8) — A DISPLAY NAME DEFAULTED FROM AN EMAIL TAKES THE
|
| 548 |
// LOCAL PART, NOT THE WHOLE ADDRESS. `name` is what the account rail, the
|
| 549 |
// monogram and every "shared by" line render. Before R8 a username was a
|
|
@@ -565,7 +566,7 @@ function AddUser({
|
|
| 565 |
}).then((r) => {
|
| 566 |
setBusy(false);
|
| 567 |
if (r.ok) {
|
| 568 |
-
onCreated(`Created ${username.trim()
|
| 569 |
setOpen(false);
|
| 570 |
setUsername("");
|
| 571 |
setName("");
|
|
|
|
| 543 |
onClick={() => {
|
| 544 |
setBusy(true);
|
| 545 |
void createUser({
|
| 546 |
+
// D-385: sent as typed. The server folds a slug and keeps an email's spelling.
|
| 547 |
+
username: username.trim(),
|
| 548 |
// ⭐ WAVE 37 · T04 (R8) — A DISPLAY NAME DEFAULTED FROM AN EMAIL TAKES THE
|
| 549 |
// LOCAL PART, NOT THE WHOLE ADDRESS. `name` is what the account rail, the
|
| 550 |
// monogram and every "shared by" line render. Before R8 a username was a
|
|
|
|
| 566 |
}).then((r) => {
|
| 567 |
setBusy(false);
|
| 568 |
if (r.ok) {
|
| 569 |
+
onCreated(`Created ${username.trim()}.`);
|
| 570 |
setOpen(false);
|
| 571 |
setUsername("");
|
| 572 |
setName("");
|
web/src/sheet/PivotTab.tsx
CHANGED
|
@@ -163,9 +163,12 @@ export default function PivotTab({ tab, databases, readOnly, onChange }: {
|
|
| 163 |
setSchema({ key: schemaKey, fields: [], userOptions: [], error: "No access" });
|
| 164 |
}
|
| 165 |
const answer = response.ok ? readPivotAnswer(raw) : null;
|
|
|
|
|
|
|
|
|
|
| 166 |
setAggregate({ key: resultKey, ...(answer ? { answer } : {
|
| 167 |
error: response.status === 403 ? "No access" : response.ok && raw?.ok === true
|
| 168 |
-
? "Invalid response" : "Refused",
|
| 169 |
}) });
|
| 170 |
} catch {
|
| 171 |
if (!controller.signal.aborted) setAggregate({ key: resultKey, error: "Unavailable" });
|
|
|
|
| 163 |
setSchema({ key: schemaKey, fields: [], userOptions: [], error: "No access" });
|
| 164 |
}
|
| 165 |
const answer = response.ok ? readPivotAnswer(raw) : null;
|
| 166 |
+
// A named field limit keeps the offered fields; only a 403 means the access changed.
|
| 167 |
+
const limit = raw?.error?.code === "pivot_field_unsupported"
|
| 168 |
+
&& typeof raw.error.message === "string" ? raw.error.message : null;
|
| 169 |
setAggregate({ key: resultKey, ...(answer ? { answer } : {
|
| 170 |
error: response.status === 403 ? "No access" : response.ok && raw?.ok === true
|
| 171 |
+
? "Invalid response" : limit ?? "Refused",
|
| 172 |
}) });
|
| 173 |
} catch {
|
| 174 |
if (!controller.signal.aborted) setAggregate({ key: resultKey, error: "Unavailable" });
|