Use the 'Select product receipt' button to select a product receipt

When i run the code for the invoice posting i found this error message.

Item Pen has a line matching policy of three-way matching but no product receipts are selected. Use the ‘Select product receipt’ button to select a product receipt.

How can i solve this?

You would have to generate the receipt - the item model group of the item is configured not to allow direct invoicing, you could alter the item model group settings as well, but I am assuming you would encounter issues outside of your modification then.