The inline tree view of the purchase order lines has a state field that is used in attrs. The popup form does not have the state view. Even if the state field is not used in the form view, closing the form view produces an error as the field state is not found. This patch is a workaround to avoid the error. The real issue should be fixed in the future but is more complex. closes odoo/odoo#27208