Commera

Commera

Open in ChatGPT
Ask ChatGPT about this page
Open in Claude
Ask Claude about this page

Gotchas

These are the traps that the other reference pages do not cover at the point of use.

Orders

  • A COD order stays a draft. Commera saves a cash on delivery order as a draft Sales Order. /commera has no button to submit it: staff open the order in Desk (View in ERP) and submit it there. If your action has a condition that needs a submitted order, the action stays hidden until then. Say so in your plugin's own help text.
  • Every store order has a delivery date. Commera sets Delivery Date on the order and on each line at placement, from the transaction date. ERPNext needs it to make a drop-ship Purchase Order from the order.
  • Drop-ship lines are not fulfilled by the store. A line with Supplier delivers to Customer set is left out of the dashboard's Fulfil action. Your plugin, or the supplier, ships it. Use record_shipment to show the shipment on the order.
  • Some items sell without stock. An Item with Delivered by Supplier (Drop Ship) set, or with Maintain Stock cleared, is always in stock on the storefront. get_items still returns the warehouse quantity in available_qty, which can be 0 for these items.

Outbound API calls

  • Frappe logs every failed request. frappe.integrations.utils.make_get_request and make_post_request write an Error Log before they raise, for every failed request: a 4xx or 5xx answer, a connection error or a reply that is not JSON. An expected 401 that your code handles, for example before it gets a new token, still adds an Error Log row.
  • No timeout argument. These helpers take no timeout= keyword. Do not pass one.

Dashboard

  • The starter page stays until you delete it. bench commera init writes a starter page under commera/pages/ and a get_summary method in api.py. Delete both when you add your own page, or the sidebar shows two rows.

New plugins

  • bench new-app names the module after the title. If you type the title "Printer", the module folder is my_app/printer/. A file my_app/printer.py then cannot be imported, because the package shadows it. Pick a title that differs from your Python file names.

Next steps

Last updated 3 days ago
Was this helpful?
Thanks!