pol_product_many2one
The product field on a purchase order line. Pick a product with one variant and it fills in; pick one with several and a grid opens.
| Technical name | pol_product_many2one |
|---|---|
| Field types | many2one |
| Views | form, list |
| Module | purchase_product_matrix, the Purchase app |
| Used in core | The product field on purchase order lines |
| Versions | Odoo 20.0, Odoo 19.0 |
| No-code setup | No. It is set in view XML and depends on module-specific data |
| Alternatives | many2one, many2one_barcode, sol_product_many2one, sol_product_many2one |
What the purchase line product does
What this means for your team
Supported options in Odoo 19
| Option | Type | What it does |
|---|---|---|
no_create | boolean | Inherited from the many-to-one field. Removes both creation paths from the dropdown.(default: false) |
no_open | boolean | Inherited. Stops the internal link opening the product.(default: false) |
the single variant call | server method | Decides whether the line is filled directly or the grid configurator opens.(since Odoo 19.0) |
The variant count comes from the server. The widget calls a method to resolve the single variant rather than counting anything in the browser, which is what makes it correct when variants are restricted by attribute rules.
Working examples
Asking the server how many variants there are
Version compatibility
| Version | Status | Notes |
|---|---|---|
| Odoo 20.0 | In development | Not released. Byte-identical to Odoo 19 on the development branch. |
| Odoo 19.0 | Verified | First version. Verified against the shipped source. |
| Odoo 18.0 | Not available | Widget does not exist under this name. |
| Odoo 17.0 | Not available | Widget does not exist under this name. |
| Odoo 16.0 | Not available | Widget does not exist under this name. |
Upgrade note. The widget is new in Odoo 19. On earlier versions the matrix was triggered differently on purchase lines, so an upgrade picks up the new behavior with the standard views and nothing needs migrating.
What is changing in Odoo 20
Common problems and fixes
| Symptom | Cause and fix |
|---|---|
| The grid never opens | Every product chosen resolves to a single variant. Expected. Check the product actually has several sellable variants. |
| The grid opens for a product with one variant | Attribute values exist that create more than one variant even if only one is used. Archive the unused variants or restrict the attribute values. |
| Quantities entered in the grid do not appear | The dialog was closed without confirming. Confirm the grid; the lines are generated on confirmation. |
| Missing widget error | The purchase product matrix module is not installed. Install it, or use a plain many-to-one on the variant field. |
| A many-to-one option is ignored | It should not be; the descriptor is inherited. Check the option spelling against the many-to-one field. |
| It behaves differently on sales orders | That side has its own widget. Expected; the two are separate implementations. |
Purchase line product vs the alternatives
| Widget | Best for | Key difference |
|---|---|---|
pol_product_many2one | The product field on purchase lines where products have variants | Asks the server whether the product is a single variant, and opens a grid when it is not |
| many2one | Any relation to one record | No variant handling |
| many2one_barcode | Picking a product by scanning | A scanner rather than a matrix |
| sol_product_many2one | Products on sales order lines | The sales side equivalent of the same idea |
| sol_product_many2one | Products on sales order lines | Same idea on the sales side |
Frequently asked questions
When does the grid open?+
What if the product has one variant?+
Does it support options?+
Is there a sales equivalent?+
Which versions have it?+
Purchasing that keeps up with your catalog
Variant matrices, vendor pricelists and reordering rules decide whether buying is a morning or a minute. We configure Odoo Purchase around your actual catalog, on versions 16 through 19.
Book a free consultation