fsanyoto commited on
Commit
7faef7d
·
verified ·
1 Parent(s): 9c7c327

Deploy AIOS web (React glide grid + FastAPI slice)

Browse files
RELEASES.json CHANGED
@@ -1,4 +1,29 @@
1
  {
2
- "current": "79d6c5838",
3
- "releases": []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  }
 
1
  {
2
+ "current": "4973f9636",
3
+ "releases": [
4
+ {
5
+ "version": "v80",
6
+ "sha": "869b8fcc6",
7
+ "date": "2026-10-13",
8
+ "subject": "release v80"
9
+ },
10
+ {
11
+ "version": "v79",
12
+ "sha": "406417b8d",
13
+ "date": "2026-10-13",
14
+ "subject": "release v79"
15
+ },
16
+ {
17
+ "version": "v78",
18
+ "sha": "aad6561d6",
19
+ "date": "2026-10-09",
20
+ "subject": "release v78: SDLC 71 with the D-7536 and D-7537 repairs"
21
+ },
22
+ {
23
+ "version": "v77",
24
+ "sha": "e741e5ca6",
25
+ "date": "2026-10-05",
26
+ "subject": "release v77"
27
+ }
28
+ ]
29
  }
VERSION CHANGED
@@ -1 +1 @@
1
- 79d6c5838
 
1
+ 4973f9636
api/deps.py CHANGED
@@ -1009,6 +1009,7 @@ def assistant_read_scope(session: Session, database, fields=None, filters=None,
1009
  visible = (perm_scope.assistant_visible_fields(canonical_fields, session.user, key)
1010
  if grant is not None else list(canonical_fields))
1011
  hidden = perm_scope.hidden_keys(session.user, key, canonical_fields, st=session.runtime)
 
1012
  visible = [field for field in visible if field.get("key") not in hidden]
1013
  if members:
1014
  hidden = set(access["hidden"])
@@ -1073,6 +1074,32 @@ def assistant_read_scope(session: Session, database, fields=None, filters=None,
1073
  return out
1074
 
1075
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1076
  def _assistant_odoo_choice_fields(session, database, fields, *, definition=None, members=()):
1077
  """Expose tenant-owned native choices only when the reader has no narrower row scope."""
1078
  if database not in _ASSISTANT_BUILT_INS and not database.startswith("ut_odoo_"):
 
1009
  visible = (perm_scope.assistant_visible_fields(canonical_fields, session.user, key)
1010
  if grant is not None else list(canonical_fields))
1011
  hidden = perm_scope.hidden_keys(session.user, key, canonical_fields, st=session.runtime)
1012
+ hidden = set(hidden) | _tenant_bound_builtin_keys(session, key, canonical_fields)
1013
  visible = [field for field in visible if field.get("key") not in hidden]
1014
  if members:
1015
  hidden = set(access["hidden"])
 
1074
  return out
1075
 
1076
 
1077
+ def _tenant_bound_builtin_keys(session, database, fields):
1078
+ """Built-in fields naming tenant.yml's own team words, which QI22 serves to that tenant only."""
1079
+ if database not in _ASSISTANT_BUILT_INS:
1080
+ return set()
1081
+ import json
1082
+ import re
1083
+ import yaml
1084
+ from harness import semantic
1085
+
1086
+ try:
1087
+ profile = yaml.safe_load((semantic.MODEL_DIR / "tenant.yml").read_text(encoding="utf-8")) or {}
1088
+ except (OSError, yaml.YAMLError):
1089
+ profile = {}
1090
+ owner = str(profile.get("key") or "").replace("_", "-")
1091
+ if owner == getattr(getattr(session, "runtime", None), "key", None):
1092
+ return set()
1093
+ words = [str(word).strip() for word in ((profile.get("params") or {}).get("team_names") or {}).values()
1094
+ if str(word).strip()]
1095
+ if not words:
1096
+ return set()
1097
+ # Keys join words with underscores (price_fisch_t1), so a letter boundary, not \b, delimits a word.
1098
+ named = re.compile(r"(?<![a-z])(?:" + "|".join(re.escape(word) for word in words) + ")", re.I)
1099
+ return {field.get("key") for field in fields if isinstance(field, dict) and named.search(json.dumps(
1100
+ {part: field.get(part) for part in ("key", "label", "description", "options")}, default=str))}
1101
+
1102
+
1103
  def _assistant_odoo_choice_fields(session, database, fields, *, definition=None, members=()):
1104
  """Expose tenant-owned native choices only when the reader has no narrower row scope."""
1105
  if database not in _ASSISTANT_BUILT_INS and not database.startswith("ut_odoo_"):
api/routes_sheet.py CHANGED
@@ -303,12 +303,17 @@ def _mirror(session: Session):
303
  # the ids, which materialises an EMPTY table and answers every cell blank.
304
  rows = [row for row in (stored.values() if isinstance(stored, dict) else stored)
305
  if isinstance(row, dict)]
306
- if not rows:
307
- raise err(409, "sheet_database_empty",
308
- f"{table_key} has no stored shipment rows. Sync shipments before binding this cell.")
309
  fields = rel.shipment_fields()
310
  hidden = perm_scope.hidden_keys(session.user, table_key, fields, st=session.runtime)
311
  fields = [field for field in fields if field["key"] not in hidden]
 
 
 
 
 
 
 
 
312
  spec_fields = sheet_mod.mirror_fields(fields)
313
  spec = rel.registry_grid_spec(cur, table_key, spec_fields, rows,
314
  id_key="odoo_id", bulk=True)
 
303
  # the ids, which materialises an EMPTY table and answers every cell blank.
304
  rows = [row for row in (stored.values() if isinstance(stored, dict) else stored)
305
  if isinstance(row, dict)]
 
 
 
306
  fields = rel.shipment_fields()
307
  hidden = perm_scope.hidden_keys(session.user, table_key, fields, st=session.runtime)
308
  fields = [field for field in fields if field["key"] not in hidden]
309
+ if not rows:
310
+ # S75-T59: a full pass stores a rowless definition that reads through the mirror.
311
+ spec = rot._source_for(cur, table_key)
312
+ if spec is None:
313
+ raise err(409, "sheet_database_empty",
314
+ f"{table_key} has no stored shipment rows. Sync shipments before binding this cell.")
315
+ memo[table_key] = (cur, {**spec, "fields": fields}, rot._filter_columns(spec, fields))
316
+ return memo[table_key]
317
  spec_fields = sheet_mod.mirror_fields(fields)
318
  spec = rel.registry_grid_spec(cur, table_key, spec_fields, rows,
319
  id_key="odoo_id", bulk=True)
platform/model/skills/amazon/charged-fees.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "Which fees did Amazon charge in this settlement?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_amzn_settlements"]
8
+ tools: []
9
+ description: "Amazon: Which fees did Amazon charge in this settlement?"
10
+ required_fields: {"ut_amzn_settlements":["settlement_id","amount","amount_type","amount_description","posted_date","sku"]}
11
+ ---
12
+ # Which fees did Amazon charge in this settlement?
13
+
14
+ ## Scope
15
+ Use this workspace's connected seller, marketplace, permissions and declared business scope.
16
+ Read every database's current field list before querying. Stop when fieldCheck reports missing_fields or unavailable.
17
+ Measured report columns can differ by seller. The required_fields block is a dependency list, not proof of source delivery.
18
+ Use completed report intervals and source timestamps. Identify currency before any monetary aggregation.
19
+ Keep all tenant figures in the answer's evidence, never in this playbook.
20
+
21
+ ## Query
22
+ Select one complete settlement_id. Discover its actual amount_type and amount_description values. Identify fee categories from the source report labels, then sum their signed amount by both categories. Document the selected category values with the answer.
23
+
24
+ ## Traps
25
+ Do not infer every negative amount is a fee. Refunds and other adjustments can be negative. Fee estimates are not charges. Do not silently flip signs or claim product profit from fees alone.
26
+
27
+ ## Check the answer
28
+ Independently subtotal the selected categories in the completed settlement report. Match their signed totals at currency precision. Also reconcile all categories to the settlement header before accepting a fee subtotal. Keep unknown categories visible.
29
+ Compare against an independently retained source report or summary, not a second query of the serving mirror.
30
+ Use read-only database tools and authorized existing source evidence. This procedure never calls Amazon or changes source records.
31
+ If the source evidence is unavailable, mark the result unverified and name the missing report.
32
+
platform/model/skills/amazon/estimated-fba-fees.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "What FBA fee does Amazon estimate for this SKU?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_amzn_fba_fee_estimates"]
8
+ tools: []
9
+ description: "Amazon: What FBA fee does Amazon estimate for this SKU?"
10
+ required_fields: {"ut_amzn_fba_fee_estimates":["_snapshot_date","sku","asin","amazon_store","your_price","estimated_fee_total","estimated_referral_fee_per_unit","expected_fulfillment_fee_per_unit","currency"]}
11
+ ---
12
+ # What FBA fee does Amazon estimate for this SKU?
13
+
14
+ ## Scope
15
+ Use this workspace's connected seller, marketplace, permissions and declared business scope.
16
+ Read every database's current field list before querying. Stop when fieldCheck reports missing_fields or unavailable.
17
+ Measured report columns can differ by seller. The required_fields block is a dependency list, not proof of source delivery.
18
+ Use completed report intervals and source timestamps. Identify currency before any monetary aggregation.
19
+ Keep all tenant figures in the answer's evidence, never in this playbook.
20
+
21
+ ## Query
22
+ Select one sku, amazon_store and currency. Use the latest completed _snapshot_date for that combination. Read your_price and the estimated fee fields per unit. Preserve snapshot date and currency beside the answer.
23
+
24
+ ## Traps
25
+ These are estimates, not charged fees. Do not sum per-unit estimates across dates or stores. Missing estimates are unknown. There is no validated estimated_fee_total semantic metric yet.
26
+
27
+ ## Check the answer
28
+ Compare the selected row and its fee components with the completed fee-preview report for the same SKU, store, price and snapshot. Require equality at report precision. Use settlements separately when the question asks what Amazon charged.
29
+ Compare against an independently retained source report or summary, not a second query of the serving mirror.
30
+ Use read-only database tools and authorized existing source evidence. This procedure never calls Amazon or changes source records.
31
+ If the source evidence is unavailable, mark the result unverified and name the missing report.
32
+
platform/model/skills/amazon/inventory-movement.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "Why did FBA stock change on this day?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_amzn_inventory"]
8
+ tools: []
9
+ description: "Amazon: Why did FBA stock change on this day?"
10
+ required_fields: {"ut_amzn_inventory":["date","msku","fnsku","disposition","location","starting_warehouse_balance","receipts","customer_shipments","customer_returns","ending_warehouse_balance"]}
11
+ ---
12
+ # Why did FBA stock change on this day?
13
+
14
+ ## Scope
15
+ Use this workspace's connected seller, marketplace, permissions and declared business scope.
16
+ Read every database's current field list before querying. Stop when fieldCheck reports missing_fields or unavailable.
17
+ Measured report columns can differ by seller. The required_fields block is a dependency list, not proof of source delivery.
18
+ Use completed report intervals and source timestamps. Identify currency before any monetary aggregation.
19
+ Keep all tenant figures in the answer's evidence, never in this playbook.
20
+
21
+ ## Query
22
+ Select one completed date, one msku and the intended disposition and locations. Read starting_warehouse_balance, receipts, customer_shipments, customer_returns and ending_warehouse_balance for each row. Explain movements with the source report's documented sign convention.
23
+
24
+ ## Traps
25
+ Other movements and adjustments may exist. Do not force an opening-plus-receipts-minus-shipments formula to balance by hiding a residual. Do not mix days, stock dispositions or AWD and FBA.
26
+
27
+ ## Check the answer
28
+ Compare opening and closing balances and each available movement column with the same ledger summary rows. Read the ledger detail report to explain the remaining difference. Retain an unexplained residual as an issue, not a fabricated adjustment.
29
+ Compare against an independently retained source report or summary, not a second query of the serving mirror.
30
+ Use read-only database tools and authorized existing source evidence. This procedure never calls Amazon or changes source records.
31
+ If the source evidence is unavailable, mark the result unverified and name the missing report.
32
+
platform/model/skills/amazon/item-sales.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "What product sales value did Amazon orders contain?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_amzn_order_items"]
8
+ tools: []
9
+ description: "Amazon: What product sales value did Amazon orders contain?"
10
+ required_fields: {"ut_amzn_order_items":["amazon_order_id","sku","purchase_date","order_status","item_price","currency"]}
11
+ ---
12
+ # What product sales value did Amazon orders contain?
13
+
14
+ ## Scope
15
+ Use this workspace's connected seller, marketplace, permissions and declared business scope.
16
+ Read every database's current field list before querying. Stop when fieldCheck reports missing_fields or unavailable.
17
+ Measured report columns can differ by seller. The required_fields block is a dependency list, not proof of source delivery.
18
+ Use completed report intervals and source timestamps. Identify currency before any monetary aggregation.
19
+ Keep all tenant figures in the answer's evidence, never in this playbook.
20
+
21
+ ## Query
22
+ Read ut_amzn_order_items in the half-open UTC purchase_date window. Exclude canceled statuses under both spellings. Partition by currency and sum item_price. Report this as gross ordered product value before tax, shipping, promotions and refunds.
23
+
24
+ ## Traps
25
+ item_price already covers the line quantity. Multiplying it by quantity double-counts. Pending rows with no price are unknown, not zero. Do not mix currencies or add order-header prices.
26
+
27
+ ## Check the answer
28
+ Compare each currency subtotal with the same line population in the completed all-orders report. Separately report missing-price rows. Preserve report identity and row grain. Do not claim net revenue or a validated semantic metric without the matching validation.
29
+ Compare against an independently retained source report or summary, not a second query of the serving mirror.
30
+ Use read-only database tools and authorized existing source evidence. This procedure never calls Amazon or changes source records.
31
+ If the source evidence is unavailable, mark the result unverified and name the missing report.
32
+
platform/model/skills/amazon/listing-prices.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "Which current Amazon listings need a price review?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_amzn_listings"]
8
+ tools: []
9
+ description: "Amazon: Which current Amazon listings need a price review?"
10
+ required_fields: {"ut_amzn_listings":["_snapshot_date","seller_sku","asin1","price","quantity"]}
11
+ ---
12
+ # Which current Amazon listings need a price review?
13
+
14
+ ## Scope
15
+ Use this workspace's connected seller, marketplace, permissions and declared business scope.
16
+ Read every database's current field list before querying. Stop when fieldCheck reports missing_fields or unavailable.
17
+ Measured report columns can differ by seller. The required_fields block is a dependency list, not proof of source delivery.
18
+ Use completed report intervals and source timestamps. Identify currency before any monetary aggregation.
19
+ Keep all tenant figures in the answer's evidence, never in this playbook.
20
+
21
+ ## Query
22
+ Use the latest completed _snapshot_date for the current seller's listing report. Inspect seller_sku, asin1, price and quantity. Return rows with missing or nonpositive price for review, distinguishing missing from measured zero.
23
+
24
+ ## Traps
25
+ Listing quantity is not a consolidated FBA inventory count. A listing's price is not realized revenue or the Buy Box price. Do not join by product names or loop through a provider to invent missing prices.
26
+
27
+ ## Check the answer
28
+ Compare flagged seller SKUs and the total listing population with the completed listings report's same snapshot. Check missing, zero and positive-price controls. Read only existing reports and databases. No change to a listing is part of this playbook.
29
+ Compare against an independently retained source report or summary, not a second query of the serving mirror.
30
+ Use read-only database tools and authorized existing source evidence. This procedure never calls Amazon or changes source records.
31
+ If the source evidence is unavailable, mark the result unverified and name the missing report.
32
+
platform/model/skills/amazon/monthly-storage.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "Which products incurred the largest monthly storage estimates?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_amzn_storage_fees"]
8
+ tools: []
9
+ description: "Amazon: Which products incurred the largest monthly storage estimates?"
10
+ required_fields: {"ut_amzn_storage_fees":["month","asin","fnsku","fulfillment_center","estimated_monthly_storage_fee"]}
11
+ ---
12
+ # Which products incurred the largest monthly storage estimates?
13
+
14
+ ## Scope
15
+ Use this workspace's connected seller, marketplace, permissions and declared business scope.
16
+ Read every database's current field list before querying. Stop when fieldCheck reports missing_fields or unavailable.
17
+ Measured report columns can differ by seller. The required_fields block is a dependency list, not proof of source delivery.
18
+ Use completed report intervals and source timestamps. Identify currency before any monetary aggregation.
19
+ Keep all tenant figures in the answer's evidence, never in this playbook.
20
+
21
+ ## Query
22
+ Select exactly one completed month. Group by asin and sum estimated_monthly_storage_fee across FNSKUs and fulfillment centers. Confirm the connected marketplace's currency before ranking. Stop if the report cannot isolate one currency.
23
+
24
+ ## Traps
25
+ A product can occupy several centers. Do not keep just the first row. Do not multiply an already extended monthly fee by units or days. An estimate is not a settlement charge.
26
+
27
+ ## Check the answer
28
+ Compare grouped totals with the same month's storage-fee report, including its center and FNSKU population. Require a zero rounded currency delta. Reconcile charged storage separately to settlement categories when available.
29
+ Compare against an independently retained source report or summary, not a second query of the serving mirror.
30
+ Use read-only database tools and authorized existing source evidence. This procedure never calls Amazon or changes source records.
31
+ If the source evidence is unavailable, mark the result unverified and name the missing report.
32
+
platform/model/skills/amazon/net-payout.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "Why does this Amazon settlement pay this amount?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_amzn_settlements"]
8
+ tools: []
9
+ description: "Amazon: Why does this Amazon settlement pay this amount?"
10
+ required_fields: {"ut_amzn_settlements":["settlement_id","amount","total_amount","amount_type","amount_description","deposit_date","posted_date"]}
11
+ ---
12
+ # Why does this Amazon settlement pay this amount?
13
+
14
+ ## Scope
15
+ Use this workspace's connected seller, marketplace, permissions and declared business scope.
16
+ Read every database's current field list before querying. Stop when fieldCheck reports missing_fields or unavailable.
17
+ Measured report columns can differ by seller. The required_fields block is a dependency list, not proof of source delivery.
18
+ Use completed report intervals and source timestamps. Identify currency before any monetary aggregation.
19
+ Keep all tenant figures in the answer's evidence, never in this playbook.
20
+
21
+ ## Query
22
+ Select exactly one settlement_id. Sum signed amount on its detail rows and group those details by amount_type and amount_description. Read total_amount from the settlement header separately. Use deposit_date for the payout date and posted_date for activity.
23
+
24
+ ## Traps
25
+ total_amount is a header total, not another transaction. Never add it to amount or sum repeated copies. Fees and refunds keep their signs. A partial settlement window cannot reconcile a complete payout.
26
+
27
+ ## Check the answer
28
+ Read the completed settlement report already delivered to the workspace. Require detail signed sum equal to the single header total at currency precision. Name any excluded detail types and reconcile them explicitly. A bank deposit is a separate check.
29
+ Compare against an independently retained source report or summary, not a second query of the serving mirror.
30
+ Use read-only database tools and authorized existing source evidence. This procedure never calls Amazon or changes source records.
31
+ If the source evidence is unavailable, mark the result unverified and name the missing report.
32
+
platform/model/skills/amazon/order-count.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "How many Amazon orders arrived?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_amzn_orders"]
8
+ tools: []
9
+ description: "Amazon: How many Amazon orders arrived?"
10
+ required_fields: {"ut_amzn_orders":["amazon_order_id","purchase_date","order_status"]}
11
+ ---
12
+ # How many Amazon orders arrived?
13
+
14
+ ## Scope
15
+ Use this workspace's connected seller, marketplace, permissions and declared business scope.
16
+ Read every database's current field list before querying. Stop when fieldCheck reports missing_fields or unavailable.
17
+ Measured report columns can differ by seller. The required_fields block is a dependency list, not proof of source delivery.
18
+ Use completed report intervals and source timestamps. Identify currency before any monetary aggregation.
19
+ Keep all tenant figures in the answer's evidence, never in this playbook.
20
+
21
+ ## Query
22
+ Use the registered amazon_order_count metric on amazon_orders for a completed UTC purchase-date interval. Resolve the connected seller and marketplace from current scope. Exclude order_status Cancelled and Canceled without case sensitivity. Count distinct amazon_order_id.
23
+
24
+ ## Traps
25
+ The order header contains only its first item's columns. Neither quantity nor item_price on this database is a whole-order total. Never apply another connector's wholesale exclusions.
26
+
27
+ ## Check the answer
28
+ Compare with the completed Amazon Sales summary order count for exactly the same marketplace and inclusive UTC dates. Query through the interval's exclusive next-day boundary. Require exact equality and the existing amazon_sales_order_count validation. A missing summary is unproven.
29
+ Compare against an independently retained source report or summary, not a second query of the serving mirror.
30
+ Use read-only database tools and authorized existing source evidence. This procedure never calls Amazon or changes source records.
31
+ If the source evidence is unavailable, mark the result unverified and name the missing report.
32
+
platform/model/skills/amazon/ordered-units.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "How many units of each SKU were ordered on Amazon?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_amzn_order_items"]
8
+ tools: []
9
+ description: "Amazon: How many units of each SKU were ordered on Amazon?"
10
+ required_fields: {"ut_amzn_order_items":["amazon_order_id","sku","purchase_date","order_status","quantity"]}
11
+ ---
12
+ # How many units of each SKU were ordered on Amazon?
13
+
14
+ ## Scope
15
+ Use this workspace's connected seller, marketplace, permissions and declared business scope.
16
+ Read every database's current field list before querying. Stop when fieldCheck reports missing_fields or unavailable.
17
+ Measured report columns can differ by seller. The required_fields block is a dependency list, not proof of source delivery.
18
+ Use completed report intervals and source timestamps. Identify currency before any monetary aggregation.
19
+ Keep all tenant figures in the answer's evidence, never in this playbook.
20
+
21
+ ## Query
22
+ Use ut_amzn_order_items with purchase_date >= the UTC start and < the exclusive end. Exclude order_status Cancelled and Canceled case-insensitively. Group by sku and sum quantity across the full result, not one page.
23
+
24
+ ## Traps
25
+ An order may contain several items. Do not deduplicate by amazon_order_id. Ordered quantity does not prove shipment or payment. Keep seller SKUs separate from ASINs.
26
+
27
+ ## Check the answer
28
+ Compare the SKU quantity totals with the completed all-orders report lines for the same seller, marketplace, states and dates. Check the line count and sum, including multi-item orders. Label the result as a report calculation until independently reconciled.
29
+ Compare against an independently retained source report or summary, not a second query of the serving mirror.
30
+ Use read-only database tools and authorized existing source evidence. This procedure never calls Amazon or changes source records.
31
+ If the source evidence is unavailable, mark the result unverified and name the missing report.
32
+
platform/model/skills/amazon/sellable-stock.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "How much sellable FBA stock is available?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_amzn_inventory"]
8
+ tools: []
9
+ description: "Amazon: How much sellable FBA stock is available?"
10
+ required_fields: {"ut_amzn_inventory":["date","msku","fnsku","asin","disposition","location","ending_warehouse_balance"]}
11
+ ---
12
+ # How much sellable FBA stock is available?
13
+
14
+ ## Scope
15
+ Use this workspace's connected seller, marketplace, permissions and declared business scope.
16
+ Read every database's current field list before querying. Stop when fieldCheck reports missing_fields or unavailable.
17
+ Measured report columns can differ by seller. The required_fields block is a dependency list, not proof of source delivery.
18
+ Use completed report intervals and source timestamps. Identify currency before any monetary aggregation.
19
+ Keep all tenant figures in the answer's evidence, never in this playbook.
20
+
21
+ ## Query
22
+ Choose one completed FBA ledger date. Filter date equal to that date and disposition equal to SELLABLE. Group by msku and sum ending_warehouse_balance across locations and FNSKUs. Confirm the database contains FBA ledger rows before summing.
23
+
24
+ ## Traps
25
+ Daily balances repeat. Never add balances across dates or combine AWD stock with FBA. This is the ledger's sellable balance, not a promise that every unit is available for a new order. No registered fba_units_on_hand validation exists yet.
26
+
27
+ ## Check the answer
28
+ Compare with the same day's FBA ledger summary. Reconcile the selected SKU balances to ledger detail using the same locations and disposition. An incomplete or absent report is not zero stock. Label an unchecked result as unverified.
29
+ Compare against an independently retained source report or summary, not a second query of the serving mirror.
30
+ Use read-only database tools and authorized existing source evidence. This procedure never calls Amazon or changes source records.
31
+ If the source evidence is unavailable, mark the result unverified and name the missing report.
32
+
platform/model/skills/odoo/active-customers.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "How many customers bought in the wholesale window?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_odoo_order_lines","ut_odoo_orders"]
8
+ tools: []
9
+ description: "Odoo: How many customers bought in the wholesale window?"
10
+ required_fields: {"ut_odoo_order_lines":["order_id","partner_id","state","wholesale_scope","order_date"],"ut_odoo_orders":["odoo_id","state","wholesale_scope","team","order_date"]}
11
+ metric: "customers"
12
+ query: {"database":"ut_odoo_order_lines","fields":["order_id","partner_id","state","wholesale_scope","order_date"],"filters":{"conj":"and","nodes":[{"conj":"or","children":"$order_id_rules"}]},"aggregates":[{"fn":"count_distinct","field":"partner_id"}],"limit":1}
13
+ source_check: {"model":"sale.order.line","domain":[["company_id","in","$company_ids"],["order_id.state","in",["sale","done"]],["order_id.team_id","in","$team_ids"],["order_partner_id","not in","$excluded_partner_ids"],["order_id.date_order",">=","$from"],["order_id.date_order","<","$until"]],"aggregate":"count_distinct","field":"order_partner_id"}
14
+ ---
15
+ # How many customers bought in the wholesale window?
16
+
17
+ ## Scope
18
+ Read the current workspace's permissions, business scope and database field lists first.
19
+ Use only the selected connection and permitted companies, channels and records.
20
+ Resolve every parameter before querying. Stop if scope or a required field is unavailable.
21
+ Use the registered metric when named below. Its definition and validation take precedence.
22
+ If the metric's declared scope differs from this workspace, report that mismatch instead of changing its definition.
23
+ Wait for a completed source snapshot. Record its timestamp and the query window with the answer.
24
+ Do not store the answer's figures in this playbook.
25
+
26
+ ## Query
27
+ Use the registered customers metric on sales_lines. Resolve $order_ids by paging ut_odoo_orders with confirmed states, wholesale_scope true, permitted team labels and the requested order_date window. Count distinct partner_id on those lines.
28
+ Build $order_id_rules as an OR group of order_id eq predicates for the selected header ids.
29
+ Use disjoint batches within the tool's published filter limits. An empty header set means no activity, never an unfiltered query.
30
+ For distinct customers, union partner ids across every batch before counting. For sums, add the disjoint batch totals.
31
+ The front-matter query is a parameterized read request, never an instruction to change a database.
32
+
33
+ ## Traps
34
+ A customer can buy in several periods or business units. Never sum their distinct counts. Use the order customer, not the sales representative or invoice contact.
35
+
36
+ ## Check the answer
37
+ Read-group sale.order.line by the direct order_partner_id under source_check's identical scope. Count distinct nonempty partner ids across all returned groups. Require exact equality, including repeated customers.
38
+ Use read-only source aggregates through the workspace's authorized source reader.
39
+ Keep the query, resolved domain, snapshot time and comparison in the answer's evidence.
40
+ An unavailable source check leaves the result unverified. A mirror checking itself is insufficient.
41
+
platform/model/skills/odoo/confirmed-orders.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "How many confirmed wholesale orders arrived?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_odoo_orders"]
8
+ tools: []
9
+ description: "Odoo: How many confirmed wholesale orders arrived?"
10
+ required_fields: {"ut_odoo_orders":["odoo_id","state","wholesale_scope","team","order_date"]}
11
+ metric: "orders"
12
+ query: {"database":"ut_odoo_orders","fields":["odoo_id","state","wholesale_scope","team","order_date"],"filters":{"conj":"and","nodes":[{"colId":"state","op":"isAnyOf","values":["sale","done"]},{"colId":"wholesale_scope","op":"isAnyOf","values":["true","1"]},{"colId":"team","op":"isAnyOf","values":"$teams"},{"colId":"order_date","op":"gte","value":"$from"},{"colId":"order_date","op":"lt","value":"$until"}]},"aggregates":[{"fn":"count"}],"limit":1}
13
+ source_check: {"model":"sale.order","domain":[["company_id","in","$company_ids"],["state","in",["sale","done"]],["team_id","in","$team_ids"],["partner_id","not in","$excluded_partner_ids"],["date_order",">=","$from"],["date_order","<","$until"]],"aggregate":"count"}
14
+ ---
15
+ # How many confirmed wholesale orders arrived?
16
+
17
+ ## Scope
18
+ Read the current workspace's permissions, business scope and database field lists first.
19
+ Use only the selected connection and permitted companies, channels and records.
20
+ Resolve every parameter before querying. Stop if scope or a required field is unavailable.
21
+ Use the registered metric when named below. Its definition and validation take precedence.
22
+ If the metric's declared scope differs from this workspace, report that mismatch instead of changing its definition.
23
+ Wait for a completed source snapshot. Record its timestamp and the query window with the answer.
24
+ Do not store the answer's figures in this playbook.
25
+
26
+ ## Query
27
+ Use the registered orders metric on sales_orders with the declared wholesale scope and half-open order-date window. Count order headers with the front-matter query. Resolve $teams from current scope.
28
+ The product stores checked wholesale_scope values as "1" or true. Accept both representations, and exclude blank or false values.
29
+ The front-matter query is a parameterized read request, never an instruction to change a database.
30
+
31
+ ## Traps
32
+ A confirmed order with no lines still counts. Counting line rows overstates orders, while distinct line-parent ids omit empty orders.
33
+
34
+ ## Check the answer
35
+ Read sale.order with source_check's domain and search_count. Require exact equality with the registered orders metric and header count. If cross-checking lines, add the separately counted headers without lines.
36
+ Use read-only source aggregates through the workspace's authorized source reader.
37
+ Keep the query, resolved domain, snapshot time and comparison in the answer's evidence.
38
+ An unavailable source check leaves the result unverified. A mirror checking itself is insufficient.
39
+
platform/model/skills/odoo/confirmed-purchases.md ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "What value of supplier orders was confirmed in the window?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_odoo_purchase_orders"]
8
+ tools: []
9
+ description: "Odoo: What value of supplier orders was confirmed in the window?"
10
+ required_fields: {"ut_odoo_purchase_orders":["odoo_id","state","confirmation_date","amount_untaxed"]}
11
+ query: {"database":"ut_odoo_purchase_orders","fields":["odoo_id","state","confirmation_date","amount_untaxed"],"filters":{"conj":"and","nodes":[{"colId":"state","op":"isAnyOf","values":["purchase","done"]},{"colId":"confirmation_date","op":"gte","value":"$from"},{"colId":"confirmation_date","op":"lt","value":"$until"}]},"aggregates":[{"fn":"sum","field":"amount_untaxed"}],"limit":1}
12
+ source_check: {"model":"purchase.order","domain":[["company_id","in","$company_ids"],["state","in",["purchase","done"]],["date_approve",">=","$from"],["date_approve","<","$until"]],"aggregate":"sum","field":"amount_untaxed"}
13
+ ---
14
+ # What value of supplier orders was confirmed in the window?
15
+
16
+ ## Scope
17
+ Read the current workspace's permissions, business scope and database field lists first.
18
+ Use only the selected connection and permitted companies, channels and records.
19
+ Resolve every parameter before querying. Stop if scope or a required field is unavailable.
20
+ Use the registered metric when named below. Its definition and validation take precedence.
21
+ If the metric's declared scope differs from this workspace, report that mismatch instead of changing its definition.
22
+ Wait for a completed source snapshot. Record its timestamp and the query window with the answer.
23
+ Do not store the answer's figures in this playbook.
24
+
25
+ ## Query
26
+ Sum amount_untaxed for purchase and done states by confirmation_date, using the half-open requested window. Partition by source currency before summing. If the available fields cannot isolate one currency, stop and request a scoped source check.
27
+ The front-matter query is a parameterized read request, never an instruction to change a database.
28
+
29
+ ## Traps
30
+ This is confirmed purchasing value, not received inventory, unpaid bills or remaining commitments. RFQs and canceled orders do not count. Confirmation date differs from planned receipt date.
31
+
32
+ ## Check the answer
33
+ Read-group purchase.order amount_untaxed:sum with source_check plus the selected source currency and row restrictions. Match date_approve to confirmation_date and require a zero rounded currency delta.
34
+ Use read-only source aggregates through the workspace's authorized source reader.
35
+ Keep the query, resolved domain, snapshot time and comparison in the answer's evidence.
36
+ An unavailable source check leaves the result unverified. A mirror checking itself is insufficient.
37
+
platform/model/skills/odoo/confirmed-revenue.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "How much confirmed wholesale revenue did we book?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_odoo_orders"]
8
+ tools: []
9
+ description: "Odoo: How much confirmed wholesale revenue did we book?"
10
+ required_fields: {"ut_odoo_orders":["odoo_id","state","wholesale_scope","team","order_date","amount_untaxed"]}
11
+ metric: "revenue"
12
+ query: {"database":"ut_odoo_orders","fields":["odoo_id","state","wholesale_scope","team","order_date","amount_untaxed"],"filters":{"conj":"and","nodes":[{"colId":"state","op":"isAnyOf","values":["sale","done"]},{"colId":"wholesale_scope","op":"isAnyOf","values":["true","1"]},{"colId":"team","op":"isAnyOf","values":"$teams"},{"colId":"order_date","op":"gte","value":"$from"},{"colId":"order_date","op":"lt","value":"$until"}]},"aggregates":[{"fn":"sum","field":"amount_untaxed"}],"limit":1}
13
+ source_check: {"model":"sale.order","domain":[["company_id","in","$company_ids"],["state","in",["sale","done"]],["team_id","in","$team_ids"],["partner_id","not in","$excluded_partner_ids"],["date_order",">=","$from"],["date_order","<","$until"]],"aggregate":"sum","field":"amount_untaxed"}
14
+ ---
15
+ # How much confirmed wholesale revenue did we book?
16
+
17
+ ## Scope
18
+ Read the current workspace's permissions, business scope and database field lists first.
19
+ Use only the selected connection and permitted companies, channels and records.
20
+ Resolve every parameter before querying. Stop if scope or a required field is unavailable.
21
+ Use the registered metric when named below. Its definition and validation take precedence.
22
+ If the metric's declared scope differs from this workspace, report that mismatch instead of changing its definition.
23
+ Wait for a completed source snapshot. Record its timestamp and the query window with the answer.
24
+ Do not store the answer's figures in this playbook.
25
+
26
+ ## Query
27
+ Use the registered sales_lines revenue metric for the selected half-open order-date window and wholesale scope. The query in front matter supplies its independent order-header cross-check. Resolve $teams to permitted business-unit labels from the workspace, never a fixed list. Use one reporting currency.
28
+ The product stores checked wholesale_scope values as "1" or true. Accept both representations, and exclude blank or false values.
29
+ The front-matter query is a parameterized read request, never an instruction to change a database.
30
+
31
+ ## Traps
32
+ Order totals include every line. Do not add header totals to line subtotals. Exclude quotations and canceled orders. Order-date revenue is different from posted invoice revenue.
33
+
34
+ ## Check the answer
35
+ Compare the registered line revenue and the header query with the read-only sale.order aggregate in source_check. The source domain uses the same companies, team ids, excluded partners and date bounds. Both deltas must round to zero at the reporting currency precision.
36
+ Use read-only source aggregates through the workspace's authorized source reader.
37
+ Keep the query, resolved domain, snapshot time and comparison in the answer's evidence.
38
+ An unavailable source check leaves the result unverified. A mirror checking itself is insufficient.
39
+
platform/model/skills/odoo/open-payables.md ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "How much do we currently owe suppliers?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_odoo_bills"]
8
+ tools: []
9
+ description: "Odoo: How much do we currently owe suppliers?"
10
+ required_fields: {"ut_odoo_bills":["odoo_id","move_type","residual"]}
11
+ metric: "ap_outstanding"
12
+ query: {"database":"ut_odoo_bills","fields":["odoo_id","move_type","residual"],"filters":{"conj":"and","nodes":[{"colId":"move_type","op":"isAnyOf","values":["in_invoice","in_refund"]}]},"aggregates":[{"fn":"sum","field":"residual"}],"limit":1}
13
+ result_scale: -1
14
+ source_check: {"model":"account.move","domain":[["company_id","in","$company_ids"],["state","=","posted"],["move_type","in",["in_invoice","in_refund"]]],"aggregate":"sum","field":"amount_residual_signed","scale":-1}
15
+ ---
16
+ # How much do we currently owe suppliers?
17
+
18
+ ## Scope
19
+ Read the current workspace's permissions, business scope and database field lists first.
20
+ Use only the selected connection and permitted companies, channels and records.
21
+ Resolve every parameter before querying. Stop if scope or a required field is unavailable.
22
+ Use the registered metric when named below. Its definition and validation take precedence.
23
+ If the metric's declared scope differs from this workspace, report that mismatch instead of changing its definition.
24
+ Wait for a completed source snapshot. Record its timestamp and the query window with the answer.
25
+ Do not store the answer's figures in this playbook.
26
+
27
+ ## Query
28
+ Use the registered ap_outstanding metric on odoo_bills. The table holds posted supplier documents. Sum signed residual, then negate the sum to express the amount owed. Do not filter invoice_date for the current balance.
29
+ The front-matter query is a parameterized read request, never an instruction to change a database.
30
+
31
+ ## Traps
32
+ Vendor invoices have negative signed residual and vendor credits positive residual. Taking each row's absolute value inflates AP. Payment status alone does not define the residual amount.
33
+
34
+ ## Check the answer
35
+ Read-group account.move amount_residual_signed:sum with source_check, then negate once. Require a zero rounded currency delta against ap_outstanding for the same company and permitted supplier population.
36
+ Use read-only source aggregates through the workspace's authorized source reader.
37
+ Keep the query, resolved domain, snapshot time and comparison in the answer's evidence.
38
+ An unavailable source check leaves the result unverified. A mirror checking itself is insufficient.
39
+
platform/model/skills/odoo/open-receivables.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "How much do customers currently owe?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_odoo_invoices"]
8
+ tools: []
9
+ description: "Odoo: How much do customers currently owe?"
10
+ required_fields: {"ut_odoo_invoices":["odoo_id","move_type","residual"]}
11
+ metric: "ar_outstanding"
12
+ query: {"database":"ut_odoo_invoices","fields":["odoo_id","move_type","residual"],"filters":{"conj":"and","nodes":[{"colId":"move_type","op":"isAnyOf","values":["out_invoice","out_refund"]}]},"aggregates":[{"fn":"sum","field":"residual"}],"limit":1}
13
+ source_check: {"model":"account.move","domain":[["company_id","in","$company_ids"],["state","=","posted"],["move_type","in",["out_invoice","out_refund"]]],"aggregate":"sum","field":"amount_residual_signed"}
14
+ ---
15
+ # How much do customers currently owe?
16
+
17
+ ## Scope
18
+ Read the current workspace's permissions, business scope and database field lists first.
19
+ Use only the selected connection and permitted companies, channels and records.
20
+ Resolve every parameter before querying. Stop if scope or a required field is unavailable.
21
+ Use the registered metric when named below. Its definition and validation take precedence.
22
+ If the metric's declared scope differs from this workspace, report that mismatch instead of changing its definition.
23
+ Wait for a completed source snapshot. Record its timestamp and the query window with the answer.
24
+ Do not store the answer's figures in this playbook.
25
+
26
+ ## Query
27
+ Use the registered ar_outstanding metric on receivables. Sum residual over posted customer invoices and credits. ut_odoo_invoices already excludes draft documents. Apply the permitted company population without a date filter for today's balance.
28
+ The front-matter query is a parameterized read request, never an instruction to change a database.
29
+
30
+ ## Traps
31
+ Credit notes reduce AR. Do not take absolute values or exclude credit notes. An invoice-date window is not a historical balance. The invoice team is not a reliable brand assignment.
32
+
33
+ ## Check the answer
34
+ Read-group account.move amount_residual_signed:sum with source_check. Match the same company currency and row restrictions. Require a zero rounded currency delta. If only a subset is readable, label it as that subset.
35
+ Use read-only source aggregates through the workspace's authorized source reader.
36
+ Keep the query, resolved domain, snapshot time and comparison in the answer's evidence.
37
+ An unavailable source check leaves the result unverified. A mirror checking itself is insufficient.
38
+
platform/model/skills/odoo/order-margin.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "What gross margin did wholesale orders earn?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_odoo_order_lines","ut_odoo_orders"]
8
+ tools: []
9
+ description: "Odoo: What gross margin did wholesale orders earn?"
10
+ required_fields: {"ut_odoo_order_lines":["order_id","partner_id","state","wholesale_scope","order_date","margin","price_subtotal"],"ut_odoo_orders":["odoo_id","state","wholesale_scope","team","order_date"]}
11
+ metric: "margin"
12
+ query: {"database":"ut_odoo_order_lines","fields":["order_id","partner_id","state","wholesale_scope","order_date","margin","price_subtotal"],"filters":{"conj":"and","nodes":[{"conj":"or","children":"$order_id_rules"}]},"aggregates":[{"fn":"sum","field":"margin"}],"limit":1}
13
+ source_check: {"model":"sale.order.line","domain":[["company_id","in","$company_ids"],["order_id.state","in",["sale","done"]],["order_id.team_id","in","$team_ids"],["order_partner_id","not in","$excluded_partner_ids"],["order_id.date_order",">=","$from"],["order_id.date_order","<","$until"]],"aggregate":"sum","field":"margin"}
14
+ ---
15
+ # What gross margin did wholesale orders earn?
16
+
17
+ ## Scope
18
+ Read the current workspace's permissions, business scope and database field lists first.
19
+ Use only the selected connection and permitted companies, channels and records.
20
+ Resolve every parameter before querying. Stop if scope or a required field is unavailable.
21
+ Use the registered metric when named below. Its definition and validation take precedence.
22
+ If the metric's declared scope differs from this workspace, report that mismatch instead of changing its definition.
23
+ Wait for a completed source snapshot. Record its timestamp and the query window with the answer.
24
+ Do not store the answer's figures in this playbook.
25
+
26
+ ## Query
27
+ Use the registered margin metric for sales_lines. Resolve $order_ids from the confirmed wholesale headers under current permissions and date scope. Sum margin. For margin percentage, use the registered margin_pct on the identical population.
28
+ Build $order_id_rules as an OR group of order_id eq predicates for the selected header ids.
29
+ Use disjoint batches within the tool's published filter limits. An empty header set means no activity, never an unfiltered query.
30
+ For distinct customers, union partner ids across every batch before counting. For sums, add the disjoint batch totals.
31
+ The front-matter query is a parameterized read request, never an instruction to change a database.
32
+
33
+ ## Traps
34
+ The Margin feature and its fields must exist. purchase_price is a per-unit cost, never a total. Order margin does not establish posted ledger COGS or landed cost. Never average row percentages.
35
+
36
+ ## Check the answer
37
+ Confirm margin is stored and aggregatable in the source field list, then read-group sale.order.line margin:sum with source_check. Require a zero rounded currency delta. For a percentage, independently reconcile both revenue and margin first.
38
+ Use read-only source aggregates through the workspace's authorized source reader.
39
+ Keep the query, resolved domain, snapshot time and comparison in the answer's evidence.
40
+ An unavailable source check leaves the result unverified. A mirror checking itself is insufficient.
41
+
platform/model/skills/odoo/ordered-units.md ADDED
@@ -0,0 +1,41 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "How many wholesale units were ordered?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_odoo_order_lines","ut_odoo_orders"]
8
+ tools: []
9
+ description: "Odoo: How many wholesale units were ordered?"
10
+ required_fields: {"ut_odoo_order_lines":["order_id","partner_id","state","wholesale_scope","order_date","qty"],"ut_odoo_orders":["odoo_id","state","wholesale_scope","team","order_date"]}
11
+ metric: "units"
12
+ query: {"database":"ut_odoo_order_lines","fields":["order_id","partner_id","state","wholesale_scope","order_date","qty"],"filters":{"conj":"and","nodes":[{"conj":"or","children":"$order_id_rules"}]},"aggregates":[{"fn":"sum","field":"qty"}],"limit":1}
13
+ source_check: {"model":"sale.order.line","domain":[["company_id","in","$company_ids"],["order_id.state","in",["sale","done"]],["order_id.team_id","in","$team_ids"],["order_partner_id","not in","$excluded_partner_ids"],["order_id.date_order",">=","$from"],["order_id.date_order","<","$until"]],"aggregate":"sum","field":"product_uom_qty"}
14
+ ---
15
+ # How many wholesale units were ordered?
16
+
17
+ ## Scope
18
+ Read the current workspace's permissions, business scope and database field lists first.
19
+ Use only the selected connection and permitted companies, channels and records.
20
+ Resolve every parameter before querying. Stop if scope or a required field is unavailable.
21
+ Use the registered metric when named below. Its definition and validation take precedence.
22
+ If the metric's declared scope differs from this workspace, report that mismatch instead of changing its definition.
23
+ Wait for a completed source snapshot. Record its timestamp and the query window with the answer.
24
+ Do not store the answer's figures in this playbook.
25
+
26
+ ## Query
27
+ Use the registered units metric. Resolve $order_ids from the permitted wholesale order headers, confirmed states and requested order-date window. Sum qty for their lines.
28
+ Build $order_id_rules as an OR group of order_id eq predicates for the selected header ids.
29
+ Use disjoint batches within the tool's published filter limits. An empty header set means no activity, never an unfiltered query.
30
+ For distinct customers, union partner ids across every batch before counting. For sums, add the disjoint batch totals.
31
+ The front-matter query is a parameterized read request, never an instruction to change a database.
32
+
33
+ ## Traps
34
+ qty preserves fractional and negative quantities. These are ordered units, not delivered pieces. Mixed units of measure cannot be presented as pieces. Do not substitute invoice quantities.
35
+
36
+ ## Check the answer
37
+ Read-group sale.order.line product_uom_qty:sum using source_check's domain. Require equality at the source quantity precision. If the question requires pieces, obtain the product-specific unit conversion and reconcile that separately.
38
+ Use read-only source aggregates through the workspace's authorized source reader.
39
+ Keep the query, resolved domain, snapshot time and comparison in the answer's evidence.
40
+ An unavailable source check leaves the result unverified. A mirror checking itself is insufficient.
41
+
platform/model/skills/odoo/overdue-receivables.md ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "How much customer debt is overdue today?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_odoo_invoices"]
8
+ tools: []
9
+ description: "Odoo: How much customer debt is overdue today?"
10
+ required_fields: {"ut_odoo_invoices":["odoo_id","move_type","residual","due_date","payment_state"]}
11
+ metric: "ar_overdue"
12
+ query: {"database":"ut_odoo_invoices","fields":["odoo_id","move_type","residual","due_date","payment_state"],"filters":{"conj":"and","nodes":[{"colId":"move_type","op":"isAnyOf","values":["out_invoice","out_refund"]},{"colId":"due_date","op":"lt","value":"$today"},{"colId":"payment_state","op":"neq","value":"paid"}]},"aggregates":[{"fn":"sum","field":"residual"}],"limit":1}
13
+ source_check: {"model":"account.move","domain":[["company_id","in","$company_ids"],["state","=","posted"],["move_type","in",["out_invoice","out_refund"]],["invoice_date_due","<","$today"],["payment_state","!=","paid"]],"aggregate":"sum","field":"amount_residual_signed"}
14
+ ---
15
+ # How much customer debt is overdue today?
16
+
17
+ ## Scope
18
+ Read the current workspace's permissions, business scope and database field lists first.
19
+ Use only the selected connection and permitted companies, channels and records.
20
+ Resolve every parameter before querying. Stop if scope or a required field is unavailable.
21
+ Use the registered metric when named below. Its definition and validation take precedence.
22
+ If the metric's declared scope differs from this workspace, report that mismatch instead of changing its definition.
23
+ Wait for a completed source snapshot. Record its timestamp and the query window with the answer.
24
+ Do not store the answer's figures in this playbook.
25
+
26
+ ## Query
27
+ Use the registered ar_overdue metric. Resolve $today to the date used by that metric. Filter due_date strictly before it and payment_state unequal to paid, retaining both customer document types.
28
+ The front-matter query is a parameterized read request, never an instruction to change a database.
29
+
30
+ ## Traps
31
+ A due date equal to today is not overdue. Missing due dates need review, not an invented date. Signed overdue credits reduce the balance. Today's residuals cannot reconstruct a past aging report.
32
+
33
+ ## Check the answer
34
+ Read-group account.move amount_residual_signed:sum with the same cutoff and posted customer domain in source_check. Require a zero rounded currency delta. Report the cutoff timezone and timestamp.
35
+ Use read-only source aggregates through the workspace's authorized source reader.
36
+ Keep the query, resolved domain, snapshot time and comparison in the answer's evidence.
37
+ An unavailable source check leaves the result unverified. A mirror checking itself is insufficient.
38
+
platform/model/skills/odoo/stock-on-hand.md ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: "How many units of this product are in internal stock?"
3
+ section: "playbooks"
4
+ owner: "role:admin"
5
+ approvers: ["role:admin"]
6
+ approvals_needed: 1
7
+ reads: ["ut_odoo_stock_quant"]
8
+ tools: []
9
+ description: "Odoo: How many units of this product are in internal stock?"
10
+ required_fields: {"ut_odoo_stock_quant":["product_id","location_usage","qty"]}
11
+ query: {"database":"ut_odoo_stock_quant","fields":["product_id","location_usage","qty"],"filters":{"conj":"and","nodes":[{"colId":"product_id","op":"eq","value":"$product_id"},{"colId":"location_usage","op":"eq","value":"internal"}]},"aggregates":[{"fn":"sum","field":"qty"}],"limit":1}
12
+ source_check: {"model":"stock.quant","domain":[["company_id","in","$company_ids"],["product_id","=","$product_id"],["location_id.usage","=","internal"]],"aggregate":"sum","field":"quantity","group_by":["product_id"]}
13
+ ---
14
+ # How many units of this product are in internal stock?
15
+
16
+ ## Scope
17
+ Read the current workspace's permissions, business scope and database field lists first.
18
+ Use only the selected connection and permitted companies, channels and records.
19
+ Resolve every parameter before querying. Stop if scope or a required field is unavailable.
20
+ Use the registered metric when named below. Its definition and validation take precedence.
21
+ If the metric's declared scope differs from this workspace, report that mismatch instead of changing its definition.
22
+ Wait for a completed source snapshot. Record its timestamp and the query window with the answer.
23
+ Do not store the answer's figures in this playbook.
24
+
25
+ ## Query
26
+ Resolve $product_id from the product the user selected. Sum qty in internal locations under the current company's permitted warehouse scope. Inventory covers all channels. Apply any declared warehouse exclusions to both query and source check.
27
+ The front-matter query is a parameterized read request, never an instruction to change a database.
28
+
29
+ ## Traps
30
+ On-hand includes reserved stock. It is not free stock or a sales-channel allocation. Never sum snapshots across dates. Do not aggregate stock.quant.value. Valuation requires quantity times the separately checked cost.
31
+
32
+ ## Check the answer
33
+ Read-group stock.quant quantity:sum by the direct product_id field for the same product, internal locations, companies and any permitted location ids. Sum the returned groups. An empty grouping can fail on stock models. Require equality at the product unit precision. Do not impose wholesale sales filters on warehouse stock.
34
+ Use read-only source aggregates through the workspace's authorized source reader.
35
+ Keep the query, resolved domain, snapshot time and comparison in the answer's evidence.
36
+ An unavailable source check leaves the result unverified. A mirror checking itself is insufficient.
37
+
platform/model/skills/royal_imports/business-context.md ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ title: Royal Imports business context
3
+ section: playbooks
4
+ owner: role:admin
5
+ approvers: [role:admin]
6
+ approvals_needed: 1
7
+ description: Royal Imports business units, wholesale scope and the Amazon channel
8
+ reads: []
9
+ tools: []
10
+ ---
11
+ # Royal Imports business context
12
+
13
+ ## Business units
14
+ The wholesale business has two sales teams: Fisch (team 5) and Royal (team 6).
15
+ Keep each team's operational results separate unless the request asks for a consolidated view.
16
+
17
+ ## Channels and wholesale scope
18
+ Amazon is a separate sales channel. Its Odoo sales ride through the GIFTWARE DEALS partner.
19
+ Wholesale scope includes confirmed orders in sale or done and excludes partners matching GIFTWARE DEALS%.
20
+ Inventory, SKU and dead-stock analysis uses all-channel sales, including Amazon.
21
+
22
+ ## Source and use
23
+ The team ids and labels come from platform/model/tenant.yml params.wholesale_team_ids and params.team_names.
24
+ The wholesale exclusion comes from params.excluded_partner_name_like in that file.
25
+ These words describe Royal Imports only. Use the current workspace's permissions and database definitions before querying.
26
+ This context grants no data access and does not change a metric's validated scope.
web/public/AIOS_DEPLOY_RECEIPT CHANGED
@@ -1 +1 @@
1
- 7cecdc7a90ec807c6034829718895f701becffebca26736aa91daef8cc6c5766
 
1
+ b468390275fa95a1e96b197943265d2582c8e29babb5fafa73beb03187b2fa04