Reference for rfqs, rfq_line_items, and rfq_line_materials in crm, with RFQ fields, the status machine, completeness check, line items, materials, and packages.
This page describes three sub-modules of src/cluster_erp/modules/crm/: rfqs/, rfq_line_items/, and rfq_line_materials/. A customer RFQ (Rfq) records what a customer asks the company to quote: its lines, the materials of each line, and a package of drawings and files. A quote in the quotations module answers it. The purchasing RFQ that the company sends to its own vendors is a different record; see purchasing RFQs.
Defined in: rfqs/models.py (Rfq, RfqPackage), rfqs/services.py (RfqService, _ACTION_RULES), the same files of rfq_line_items and rfq_line_materials, and their routes.py and metadata.py.
Count: 4 tables; 18 RFQ routes, 6 line item routes, and 6 material routes (@router. decorators); 8 ActionMeta entries.
_ACTION_RULES names, for each action, the target status, the allowed source statuses, and whether a reason is required (src/cluster_erp/modules/crm/rfqs/services.py:60-72).
In prose: a new RFQ is assigned and reviewed, then marked quoted. A quoted RFQ is won, lost, or expires. A new or reviewed RFQ can be declined or expire. A declined, expired, or lost RFQ can be reopened. decline and lose need a reason. Every transition checks the record version (src/cluster_erp/modules/crm/rfqs/services.py:278-304).
Create needs an existing customer. An RFQ with the same subject for the same customer within 7 days is refused (src/cluster_erp/modules/crm/rfqs/services.py:147-160, src/cluster_erp/modules/crm/rfqs/services.py:506-527).
A normal RFQ due within PRIORITY_THRESHOLD_HOURS (48) becomes high (src/cluster_erp/modules/crm/rfqs/services.py:82, src/cluster_erp/modules/crm/rfqs/services.py:165-172).
quote is blocked while the completeness log has unmet items: a due date, at least one line item, and an e-mail or communication channel of the customer, counted with CountPartyChannels (src/cluster_erp/modules/crm/rfqs/services.py:326-417).
When a package becomes complete, RfqPackageCompleted is emitted (src/cluster_erp/modules/crm/rfqs/services.py:593-620).
from-bom takes the product of the line's customer part and asks GetBomMaterials for the distinct leaf materials (src/cluster_erp/modules/crm/rfq_line_materials/services.py:95-130).